learning
Why an email API beats raw SMTP
Why an email API beats raw SMTP
Sending directly via SMTP sounds simple and has real hidden costs:
- No visibility into whether an email delivered or bounced.
- Deliverability problems — your IP reputation and SPF/DKIM/DMARC configuration all need to be correct or emails silently land in spam. Even a correct email to a valid address gets dropped if the sending domain has no established trust, and a fresh domain has no reputation history regardless.
- No built-in retry for transient failures.
Resend and similar providers abstract that behind an API call and handle the deliverability infrastructure as their product.
await resend.emails.send({
from: "[email protected]",
to: user.email,
subject: "Confirm your email",
html: renderConfirmationEmail(confirmationCode),
});
The visibility a raw send doesn't give you matters directly for a real flow: if a confirmation email hard-bounces because the address doesn't exist, the app can know and prompt the user to correct it, rather than the user just never receiving anything and assuming the app is broken.
Email sending goes through the transactional outbox rather than being called inline in a request handler — if the API has a transient failure, the outbox retries later instead of the confirmation being silently and permanently lost the moment one call happened to fail.
A dedicated no-reply sending address is a deliberate signal to both the recipient and mail providers that this address doesn't accept replies — it keeps replies out of an unmonitored mailbox, and it's the standard, recognisable pattern for automated messages versus a real person writing.