Skip to content

Simple asynchronous wrapper for Django's send_mail() using Python's threading

Notifications You must be signed in to change notification settings

ui/django_asynchronous_send_mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

django-asynchronous_send_mail

A very simple wrapper around Django's built in send_mail to send email asynchronously using Python's threading - really useful for servers with slow internet connection. If you want more advanced features like mail queuing or scheduling you should look at other alternatives such as Django Mailer

OVERVIEW

For a more thorough explanation of what this bit of code tries to solve please visit: http://ui.co.id/blog/asynchronous-send_mail-in-django

This is not intended to replace

INSTALLATION

Put django_asynchronous_send_mail in your Python path.

USAGE

try:
from django_asynchronous_send_mail import send_mail
except:
from django.core.mail import send_mail

The rest is the same as Django's normal send_mail(), in fact, if your project already uses Django's built in send_mail(), you don't need to change anything :)

Example:

send_mail('Subject here', 'Here is the message.', '[email protected]', ['[email protected]'], fail_silently=False)

If you want to send HTML email:

send_mail('Subject here', 'Here is the message.', '[email protected]', ['[email protected]'], fail_silently=False, html = '<HTML_TEXT_HERE>')

About

Simple asynchronous wrapper for Django's send_mail() using Python's threading

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages