Skip to content

Instantly share code, notes, and snippets.

@yat1ma30
Created October 8, 2014 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yat1ma30/fdbce60638080db26308 to your computer and use it in GitHub Desktop.
Save yat1ma30/fdbce60638080db26308 to your computer and use it in GitHub Desktop.
HerokuでDjangoでメール送信 ref: http://qiita.com/ottati/items/6d1648ed22704792c569
heroku addons:add sendgrid
if HEROKU:
EMAIL_HOST_USER = os.environ['SENDGRID_USERNAME']
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_PASSWORD = os.environ['SENDGRID_PASSWORD']
from django.core.mail import send_mail
send_mail(
u'Title!',
u'Content',
'Ottatiyarou <info@otatin.com>',
[送信先アドレス, ],
fail_silently=True,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment