Skip to content

Instantly share code, notes, and snippets.

@reidransom
Created July 9, 2011 17:28
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 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 = 'youremail@gmail.com'
EMAIL_HOST_PASSWORD = 'yourpassword'
EMAIL_PORT = 587
# test with
$ python manage.py shell
>>> from django.core.mail import EmailMessage
>>> email = EmailMessage('Hello', 'World', to=['youremail@somewhere.com'])
>>> email.send()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment