Send Transactional Email from a Verified Domain with an API or SMTP
Password resets, login codes, receipts, and alerts are easier to operate when application email has its own delivery path. Here are the setup decisions that matter before sending. Verify the sending domain Use a domain you control, then add the DNS records shown by zaSend: SPF authorizes the delivery service. DKIM signs each message so recipients can verify it. DMARC tells receiving systems how…
When verifying a sending domain for transactional emails, it is crucial to control the domain and add the necessary DNS records provided by zaSend. These records include SPF for authorizing the delivery service, DKIM for signing each message, and DMARC to guide receiving systems on handling authentication results. After updating DNS and confirming all required records match the generated values, the domain is ready for use.
There are two ways to send transactional emails: via API or SMTP. The API is ideal for applications that already use HTTPS requests, requiring the sender, recipient, subject, and HTML or text body. The API key should be securely stored on the server and not included in browser code. SMTP is suitable when the application or framework already supports SMTP. In this case, use the host and port from the domain's SMTP settings, authenticate with a domain sending key, and enable TLS.
To begin sending a real application message, start with one message type, like a password reset. Ensure the subject is clear, include a plain-text alternative, and add an expiring link. Record the provider message ID to connect delivery events to the user action that generated the message.
Handling delivery events is essential. Use webhooks to track accepted, delivered, bounced, and complained messages. Temporary delivery failures may be retried, while permanent bounces should be removed from future sends. Always keep sending safe by storing keys in environment variables or a secrets manager, using a separate key for each application if possible, rotating keys when access changes, and starting with a small sending volume.
Check delivery logs before increasing volume. For more detailed information, refer to the zaSend API documentation and SMTP relay guide.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.