MailGun as an SMTP Server for Django Appsby dave on 2011-06-07
Gmail is a frequently used SMTP host for Django apps. Its free and relatively simple to setup which is ideal for small apps. There are a few significant downfalls. First, its limited to 500 emails a day with no option to upgrade. Second, it limits and even re-writes all outgoing emails to the username of the connector.
For example if you're trying to send an email from email@example.com or firstname.lastname@example.org you're out of luck because all of those emails will actually get sent at email@example.com or whatever email account you have configured. I'm sure this saves millions of people from millions of spam but it adds a bit of annoyance to developer's lives.
The recently launched MailGunoffers a great solution. Its free for up to 200 emails per day and super cheap and dramatically scalable after that. It also works as a drop in replacement for whatever service you were using for your django smtp server. Changing will take you less time than reading this article.
- Sign up for MailGun
- Go to the control panel and click on the YOURHOST.mailgun.org server created for you.
- In the upper right you will find your "SMTP Authentication" credentials for this server.
Open the settings.py in your django app and configure your email with the given credentials. It should look something like this.
Test it out!