Created
October 8, 2014 04:41
-
-
Save yat1ma30/fdbce60638080db26308 to your computer and use it in GitHub Desktop.
HerokuでDjangoでメール送信 ref: http://qiita.com/ottati/items/6d1648ed22704792c569
This file contains 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
heroku addons:add sendgrid |
This file contains 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
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'] |
This file contains 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
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