Last active
May 20, 2016 20:47
-
-
Save sendgrid-gists/08cacf1d3bb29f5bb1db5099a1dc9f43 to your computer and use it in GitHub Desktop.
"Hello World" for email, using SendGrid with PHP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// using SendGrid's PHP Library | |
// https://github.com/sendgrid/sendgrid-php | |
require 'vendor/autoload.php'; | |
$sendgrid = new SendGrid("SENDGRID_APIKEY"); | |
$email = new SendGrid\Email(); | |
$email->addTo("[email protected]") | |
->setFrom("[email protected]") | |
->setSubject("Sending with SendGrid is Fun") | |
->setHtml("and easy to do anywhere, even with PHP"); | |
$sendgrid->send($email); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment