POST /v1/email/messages. Use it when a system can only send e-mail over SMTP; anything you build yourself is simpler on the API.
Settings
The console shows the same settings on the application’s Email page, and the key is made under Application settings → API keys. The key decides the application: its verified domains, its log and its webhooks. A
tk_test_ key is refused, as on the API.
TLS is required. On port 587 the server refuses to log in before STARTTLS; port 465 is encrypted from the start. Plain port 25 is not offered.
What is sent
- From must be an address on a verified domain of the key’s application, any local part. The name in the From header is kept.
- Each recipient is its own message. Every address in To, Cc and Bcc is sent as a separate message, recorded in the log with its own id, counted against the daily limit and charged as one message. A Bcc address never appears in the copies the others receive.
- Reply-To, the subject, the HTML part and the text part are kept as written.
- Attachments are carried, up to 10 MiB together (the whole e-mail can be up to 12 MiB). Executable types (such as
.exe,.bat,.cmd,.com,.js,.msi,.scrand.vbs) are refused.
550 5.7.1 for a suppressed address. Sending the same e-mail again is safe: the recipients that already received it are not sent a second copy. The messages appear in Email → Messages and send the same email.* webhooks as the API’s.
Reply codes
A reply that starts with 5 is permanent: fix the cause before sending again. A reply that starts with 4 is temporary: your mail client or library retries later on its own. The reply’s text says which case it is.Laravel
In.env:
MAIL_SCHEME=smtp on port 587 upgrades the connection with STARTTLS. For port 465 use MAIL_SCHEME=smtps and MAIL_PORT=465. Laravel versions before 11 read MAIL_ENCRYPTION=tls instead of MAIL_SCHEME.
WordPress
With the WP Mail SMTP plugin, choose Other SMTP as the mailer and fill in:
Set From Email to an address on your verified domain and turn on Force From Email. For port 465, choose SSL as the encryption.
Nodemailer
port: 465 and secure: true, and leave out requireTLS.
Keep the key on the server, in an environment variable or a secret store, never in code a browser or a phone app receives.