How can I setup Mailgun on Django?

Issue

I want to setup the Mailgun add-on for Django on Heroku

Resolution

You can use Mailgun as an SMTP relay; there is more information about that here.

Fortunately, when using Heroku, all of the necessary Mailgun variables are stored as environmental variables. You can update your Heroku-side settings.py file with the following variables; Django emails should "just work".

EMAIL_HOST = os.environ.get('MAILGUN_SMTP_SERVER', '')
EMAIL_PORT = os.environ.get('MAILGUN_SMTP_PORT', '')
EMAIL_HOST_USER = os.environ.get('MAILGUN_SMTP_LOGIN', '')
EMAIL_HOST_PASSWORD = os.environ.get('MAILGUN_SMTP_PASSWORD', '')

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support
Terms of Service Privacy Cookies © 2018 Salesforce.com