Email configuration

Note

For now the project includes only Mailgun and Sendgrid configuration. Feel free to contribute definitions for other providers.

Mailgun add-on

Retrieves Mailgun add-on settings from the environment and defines the following variables in the herokuify.mail.mailgun module:

  • MAILGUN_API_KEY
  • MAILGUN_SMTP_SERVER
  • MAILGUN_SMTP_LOGIN
  • MAILGUN_SMTP_PASSWORD
  • MAILGUN_SMTP_PORT

as well as EMAIL_* settings for use in Django config:

  • EMAIL_HOST
  • EMAIL_HOST_USER
  • EMAIL_HOST_PASSWORD
  • EMAIL_PORT

Django config

Import settings from this module into your Django project settings:

from herokuify.mail.mailgun import EMAIL_HOST, EMAIL_HOST_USER, EMAIL_HOST_PASSWORD, EMAIL_PORT

Installing add-on

Use heroku addons command to subscribe for Mailgun add-on:

heroku addons:add mailgun:<PLAN>

Quick start with:

heroku addons:add mailgun:starter

Sendgrid add-on

Retrieves Sendgrid add-on settings from the environment and defines the following variables in the herokuify.mail.sendgrid module:

  • SENDGRID_SMTP_SERVER
  • SENDGRID_USERNAME
  • SENDGRID_PASSWORD
  • SENDGRID_SMTP_PORT

as well as EMAIL_* settings for use in Django config:

  • EMAIL_HOST
  • EMAIL_HOST_USER
  • EMAIL_HOST_PASSWORD
  • EMAIL_PORT
  • EMAIL_USE_TLS

Django config

Import settings from this module into your Django project settings:

from herokuify.mail.sendgrid import EMAIL_HOST, EMAIL_HOST_USER, EMAIL_HOST_PASSWORD, EMAIL_PORT, EMAIL_USE_TLS

Installing add-on

See Sendgrid add-on page. Quick start with:

heroku addons:add sendgrid:starter

Defined module attributes

Mailgun

herokuify.mail.mailgun.MAILGUN_API_KEY = None

Mailgun api key for using the REST API

herokuify.mail.mailgun.MAILGUN_SMTP_SERVER = None

Mailgun SMTP server host

herokuify.mail.mailgun.MAILGUN_SMTP_LOGIN = None

Mailgun SMTP server login

herokuify.mail.mailgun.MAILGUN_SMTP_PASSWORD = None

Mailgun SMTP server password

herokuify.mail.mailgun.MAILGUN_SMTP_PORT = None

Mailgun SMTP server port

herokuify.mail.mailgun.EMAIL_HOST = None

Email host for sending mail

herokuify.mail.mailgun.EMAIL_HOST_USER = None

Email server username

herokuify.mail.mailgun.EMAIL_HOST_PASSWORD = None

Email server password

herokuify.mail.mailgun.EMAIL_PORT = None

Email server SMTP port

Sendgrid

herokuify.mail.sendgrid.SENDGRID_SMTP_SERVER = u'smtp.sendgrid.net'

Sendgrid SMTP server host

herokuify.mail.sendgrid.SENDGRID_USERNAME = None

Sendgrid SMTP server login

herokuify.mail.sendgrid.SENDGRID_PASSWORD = None

Sendgrid SMTP server password

herokuify.mail.sendgrid.SENDGRID_SMTP_PORT = 587

Sendgrid SMTP server port

herokuify.mail.sendgrid.EMAIL_HOST = u'smtp.sendgrid.net'

Email host for sending mail

herokuify.mail.sendgrid.EMAIL_HOST_USER = None

Email server username

herokuify.mail.sendgrid.EMAIL_HOST_PASSWORD = None

Email server password

herokuify.mail.sendgrid.EMAIL_PORT = 587

Email server SMTP port

herokuify.mail.sendgrid.EMAIL_USE_TLS = True

Email server TLS secure connection

Table Of Contents

Previous topic

Cache

Next topic

Amazon AWS settings

Python Development

Django web development for startups and businesses.

Quality Python development and scientific applications.

Quick links

Edit this document

The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.