Sending emails using sendgrid on heroku for a Django App

wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
$ heroku --version
heroku-toolbelt/3.43.3 (x86_64-linux) ruby/1.9.3
$ which heroku
/usr/local/heroku/bin/heroku
$ heroku login
Enter your Heroku credentials.
Email: user@heroku.com
Password:
$ heroku addons:create sendgrid:starter
$ heroku config:get SENDGRID_USERNAMEuser@heroku.com$ heroku config:get SENDGRID_PASSWORDpassword
import sendgridsg = sendgrid.SendGridClient(YOUR_SENDGRID_API_KEY')
message = sendgrid.Mail()
message.add_to('To_Email')
message.set_from('User_Name')
message.set_subject('Email_Subject')
message.set_html('Body')
sg.send(message)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store