Skip to content

wzuo/django_multi_mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

django_multi_mailer

Multiple e-mail backends for Django Framework

Written for Django 1.7 and Python 3

How to install it?

In settings.py:

Add 'django_multi_mailer' into INSTALLED_APPS

Set the EMAIL_BACKEND variable to EMAIL_BACKEND = 'django_multi_mailer.backends.MultiEmailBackend'

Set the EMAIL_MULTI variable to

EMAIL_MULTI = [
    {
        'HOST': 'put_your_host_here.com',
        'PORT': 25,
        'USE_SSL': False,
        'USE_TLS': True,
        'TIMEOUT': 120,
        'FAIL_SILENTLY': False,
        'CREDENTIALS': [
            ('[email protected]', 'password'),
            ('[email protected]', 'password'),
            ('[email protected]', 'password'),
            ('[email protected]', 'password'),
            ('[email protected]', 'password')
        ]
    },
    {
        'HOST': 'second_host.com',
        'PORT': 25,
        'USE_SSL': False,
        'USE_TLS': True,
        'TIMEOUT': 120,
        'FAIL_SILENTLY': False,
        'CREDENTIALS': [
            ('first@second_host.com', 'password'),
        ]
    },
]

That's all, you can now send e-mails using default django send_mail function

How to send an e-mail?

from django.core.mail import send_mail
subject = 'Email Topic'
content = 'Email Content'

recipient_list = ['[email protected]']
send_mail(subject, content, None, recipient_list)

About

Multiple e-mail backends for Django Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages