/
var
/
www
/
doncode.com.ua
/
www
/
mailer
/
/var/www/doncode.com.ua/www/mailer
mkdir
upload
Name
Size
Mode
Actions
vendor/
-
0755
rm
.gitignore
13
0644
edit
dl
rm
composer.json
52
0644
edit
dl
rm
composer.lock
6534
0644
edit
dl
rm
index.php
1110
0644
edit
dl
rm
sendgrid.env
96
0644
edit
dl
rm
Edit:
/var/www/doncode.com.ua/www/mailer/index.php
(1110B)
<?php require 'vendor/autoload.php'; // If you're using Composer (recommended) // Comment out the above line if not using Composer // require("<PATH TO>/sendgrid-php.php"); // If not using Composer, uncomment the above line and // download sendgrid-php.zip from the latest release here, // replacing <PATH TO> with the path to the sendgrid-php.php file, // which is included in the download: // https://github.com/sendgrid/sendgrid-php/releases $email = new \SendGrid\Mail\Mail(); $email->setFrom("info@doncode.com.ua", "Doncode"); $email->setSubject("Sending with SendGrid is Fun"); $email->addTo("g0502212339@gmail.com", "Serg"); $email->addContent("text/plain", "and easy to do anywhere, even with PHP"); //$email->addContent( // "text/html", "<strong>and easy to do anywhere, even with PHP</strong>" //); $sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY')); try { $response = $sendgrid->send($email); print $response->statusCode() . "\n"; print_r($response->headers()); print $response->body() . "\n"; } catch (Exception $e) { echo 'Caught exception: '. $e->getMessage() ."\n"; }
Save
cmd:
run