Skip to content

Instantly share code, notes, and snippets.

@reidransom
Created July 9, 2011 17:28
Show Gist options
  • Save reidransom/1073773 to your computer and use it in GitHub Desktop.
Save reidransom/1073773 to your computer and use it in GitHub Desktop.
django and gmail
# settings.py
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'yourpassword'
EMAIL_PORT = 587
# test with
$ python manage.py shell
>>> from django.core.mail import EmailMessage
>>> email = EmailMessage('Hello', 'World', to=['[email protected]'])
>>> email.send()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment