Send app email through Brevo SMTP
Point your app or email client at smtp-relay.brevo.com to send transactional emails such as order confirmations and password resets, with an SMTP key, not an API key.

How it works
const nodemailer = require("nodemailer");
async function main() {
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host: "smtp-relay.brevo.com",
port: 587,
secure: false, // true for 465, false for other ports
auth: {
user: "[email protected]", // generated brevo user
pass: "xxxxxxxxx", // generated brevo password
},
});
// send mail with defined transport object
let info = await transporter.sendMail({
from: '"Sender Name" <[email protected]>', // sender address
to: "[email protected]", // list of receivers
subject: "Hello ✔", // Subject line
text: "Hello {{ contact.FIRSTNAME }} , This is an SMTP message with customizations", // plain text body
});
console.log("Message sent: %s", info.messageId);
// Message sent: <[email protected]>
}
main().catch(console.error);
curl --request POST \
--url https://api.brevo.com/v3/smtp/email \
--header 'accept: application/json' \
--header 'api-key:YOUR_API_KEY' \
--header 'content-type: application/json' \
--data '{
"sender":{
"name":"Alex from Brevo",
"email":"[email protected]"
},
"to":[
{
"email":"[email protected]",
"name":"John Doe"
}
],
"subject":"Hello from Brevo!",
"htmlContent":"<html><head></head><body><p>Hello,</p>This is my first transactional email sent from Brevo.</p></body></html>"
}'
import { BrevoClient } from '@getbrevo/brevo';
const brevo = new BrevoClient({ apiKey: 'your-api-key' });
const result = await brevo.transactionalEmails.sendTransacEmail({
subject: 'Hello from Brevo!',
htmlContent: '<html><body><p>Hello,</p><p>This is my first transactional email.</p></body></html>',
sender: { name: 'Alex from Brevo', email: '[email protected]' },
to: [{ email: '[email protected]', name: 'John Doe' }],
});
console.log('Email sent. Message ID:', result.messageId);
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)
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Brevo\Brevo;
use Brevo\TransactionalEmails\Requests\SendTransacEmailRequest;
use Brevo\TransactionalEmails\Types\SendTransacEmailRequestSender;
use Brevo\TransactionalEmails\Types\SendTransacEmailRequestToItem;
$client = new Brevo(apiKey: 'your-api-key');
$result = $client->transactionalEmails->sendTransacEmail(
new SendTransacEmailRequest([
'subject' => 'Hello from Brevo!',
'htmlContent' => '<html><body><p>Hello,</p><p>This is my first transactional email.</p></body></html>',
'sender' => new SendTransacEmailRequestSender([
'name' => 'Alex from Brevo',
'email' => '[email protected]',
]),
'to' => [
new SendTransacEmailRequestToItem([
'email' => '[email protected]',
'name' => 'John Doe',
]),
],
])
);
echo 'Email sent. Message ID: ' . $result->messageId . PHP_EOL;
Send a transactional email from my verified sender to me@example.com with the subject "Your order is confirmed", then show me the message ID and its status in the logs.
The first panel uses nodemailer over SMTP. The API panels send the same kind of message with POST /v3/smtp/email, the Node.js, Python and PHP SDKs, or an MCP prompt.
Setup steps
Copy your SMTP credentials
Retrieve your SMTP username and password from SMTP and API settings. Under the SMTP tab, copy existing credentials or generate new ones. Do not paste an API key here.
Pick a port
Non-encrypted: use ports 587 or 2525. Use 465 with SSL or TLS. Leave the encryption field empty on any other port.
Set the SMTP host
The host is smtp-relay.brevo.com. Sign in with your SMTP login and an SMTP key. The Node.js example uses nodemailer with host smtp-relay.brevo.com and port 587.
Send a test message
Run the example. It logs Message sent with the message ID of the email.



