Tuesday, November 11, 2008

Django Errors: SMTP AUTH and SMTPAuthenticationError

FYI, if you have issues with Django's send_mail with a gmail account, in your settings.py use the following template.

# EMAIL SETTINGS
EMAIL_HOST = "smtp.gmail.com"
EMAIL_PORT = "587"
EMAIL_HOST_USER = "your_account_user@gmail.com"
EMAIL_HOST_PASSWORD = "password"
# Controls whether a secure connection is used.
EMAIL_USE_TLS = True


If you are getting SMTPAuthenticationError with a non gmail account:

# EMAIL SETTINGS
EMAIL_HOST = "mail.whatever-domain.com"
EMAIL_PORT = "25"
EMAIL_HOST_USER = "username"
EMAIL_HOST_PASSWORD = "password"
# Controls whether a secure connection is used.
EMAIL_USE_TLS = True

No comments: