Monday, February 13, 2012

send gmail in django

Send Email by GMail in Django
1, make sure POP3 enabled with your Google Account
http://support.google.com/mail/bin/answer.py?hl=en&answer=13287

2, Add configuration to settings.py
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'youremail@gmail.com'
EMAIL_HOST_PASSWORD = 'yourpassword'
EMAIL_PORT = 587

update: you may need turn on 2 step verification in your Google account setting. Otherwise, you may get warning, and sending may be prohibited by Google.

No comments:

Post a Comment