Django SMTP Integration Guide

Guide to integrate Mailazy with your Django application


Prerequisites

You need to complete these given prerequisites, you can skip the step if you have already completed.

  1. Sign up for a Mailazy account.
  2. Complete Domain Authentication.
  3. Generate the Mailazy Access Key

Integrate Mailazy with Django

There is more detailed information about sending email over SMTP with Django on the Django project website.

First start by adding the following to settings.py:

EMAILHOST = 'smtp.mailazy.com' EMAILHOSTUSER = 'accesskey' EMAILHOSTPASSWORD = ‘accesssecret’ EMAILPORT = 587 EMAILUSETLS = True

Then to send email you can do the following inside yourapp.views.py

from django.core.mail import send_mail
send_mail('Subject here', 'Here is the message.', 'from@example.com', ['to@example.com'], fail_silently=False)