Django under development: Sending emails through gmail

| | Comments (0)
Some of us does not have a approved SMTP server on our development server, or are working outside the office. So how do you then send email when using Django as your python framework?

The answer is simple: Gmail

You will need:
  • A gmail account
  • Django (of course...)
Open up your settings.py and enter the following information:

EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '<user>@gmail.com'
EMAIL_HOST_PASSWORD = '<password>
EMAIL_PORT = 587
EMAIL_USE_TLS = True

That's it. Given, you can't use it in your production environment. But it works like a charm during development. And if you need help sending html mail with alternative content (html+txt), check out Ross Poultons article Easy Multi-Part E-Mails with Django

Categories

,

Leave a comment

About this Entry

This page contains a single entry by Niklas Bivald published on August 26, 2008 7:45 AM.

mojoPortal error on shared files download/upload was the previous entry in this blog.

What do you want from shift? The "completely free and elegant way [for os x users] to handle their MySQL databases." is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.21-en