Send an email asynchronously using Gmail as the SMTP server
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Send an email using Gmail as the SMTP server. Because of the high cost of setting up the connection, the email is sent asynchronously. It is configured to use Django's settings file by default.


In a Django environment:

In your file, create two variables:


Non-Django envrionment:

Remove from django.conf import settings from, and set the GMAIL_USERNAME and GMAIL_PASSWORD variables.

Example Usage

import gmail
to = ""
subject = "Hey!"
body = "Have a great day"
html = "Have a <strong>great</strong> day"
gmail.send(to, subject, body, html)