Send email from Django over SMTP
Configure Django's built-in SMTP email backend to send through Unitpost. This is the same job as Nodemailer — Python instead of Node.
Configure your settings
Add the SMTP settings to
settings.py. Keep the API key in an environment variable.PythonEMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" EMAIL_HOST = "smtp.unitpost.com" EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_HOST_USER = "unitpost" EMAIL_HOST_PASSWORD = os.environ["UNITPOST_API_KEY"] DEFAULT_FROM_EMAIL = "you@yourdomain.com"Send an email
Use
send_mailor anEmailMessage. The from address must be on a verified domain.Pythonfrom django.core.mail import send_mail send_mail( subject="Hello from Unitpost", message="Sent via SMTP.", from_email="you@yourdomain.com", recipient_list=["customer@example.com"], html_message="<h1>Welcome!</h1>", )Verify delivery
Check your Unitpost Activity view for the message and its status.