Send email from Django through SMTP
Point Django's SMTP email backend at the Brevo SMTP relay to send transactional emails from your application.

How it works
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp-relay.brevo.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'YOUR_SMTP_KEY'
pip install brevo-python
from brevo import Brevo
from brevo.transactional_emails import (
SendTransacEmailRequestSender,
SendTransacEmailRequestToItem,
)
client = Brevo(api_key="your-api-key")
result = client.transactional_emails.send_transac_email(
subject="Hello from Brevo!",
html_content="<html><body><p>Hello,</p><p>This is my first transactional email.</p></body></html>",
sender=SendTransacEmailRequestSender(
name="Alex from Brevo",
email="[email protected]",
),
to=[
SendTransacEmailRequestToItem(
email="[email protected]",
name="John Doe",
)
],
)
print("Email sent. Message ID:", result.message_id)
Use your SMTP login and SMTP key from SMTP and API settings, not an API key. The SDK tab uses an API key.
Ask your AI agent
Use AI assistants to interact with your Brevo account using natural language.
Before I send email from my Django app, check that I have a verified sender and an authenticated sending domain. List what is missing.
Read-only: it reads your Brevo account through the Brevo MCP server and changes nothing.
Set it up
Authenticate your sender
Add and verify your sender and sending domain in Brevo. Domain authentication is required for reliable deliverability.
Add the SMTP settings
The SMTP host is smtp-relay.brevo.com and port 587 uses STARTTLS. Under the SMTP tab of SMTP and API settings, copy your SMTP username and password or generate new ones. Use an SMTP key, not an API key.
Send and check the log
Send a test message, then confirm delivery in Brevo > Transactional > Email logs. The SMTP relay does not support batch sending. Use the batch sending API endpoints for batch operations.


