Skip to content

Instantly share code, notes, and snippets.

@sendgrid-gists
Last active May 11, 2016 17:46
Show Gist options
  • Save sendgrid-gists/25a7f00db3f75026602583ed132c500d to your computer and use it in GitHub Desktop.
Save sendgrid-gists/25a7f00db3f75026602583ed132c500d to your computer and use it in GitHub Desktop.
"Hello World" for email, using SendGrid with Python.
# using SendGrid's Python Library
# https://github.com/sendgrid/sendgrid-python
import sendgrid
client = sendgrid.SendGridClient("SENDGRID_APIKEY")
message = sendgrid.Mail()
message.add_to("test@sendgrid.com")
message.set_from("you@youremail.com")
message.set_subject("Sending with SendGrid is Fun")
message.set_html("and easy to do anywhere, even with Python")
client.send(message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment