$ sudo easy_install sendgrid
or
$ git clone git@github.com:sendgrid/sendgrid-python
$ cd sendgrid-python
$ sudo python setup.py install
import sendgrid
# build an auth object
sgauth = sendgrid.Sendgrid("username", "password",
secure=True)
# build a message object
sgmsg = sendgrid.Message("from@address.com", "subject",
"plaintext body", "html body")
# add a recipient
sgmsg.add_to("my@recipient.com")
# send the message
sgauth.smtp.send(sgmsg)
|
|
• http://goo.gl/aWMcG • @iandouglas736 #pyconca