SMTP (Simple Mail Transfer Protocol) is the standard way computers send email to each other. It's been around since the 1980s and is the backbone of all email delivery.
Think of SMTP as the postal system for the internet. When you mail a letter, you don't drive it to the recipient's house — you drop it at the post office, and the postal system handles routing and delivery.
SMTP works the same way. Your app hands an email to an SMTP relay (like Resend), and the relay handles delivering it to the recipient's inbox.
An SMTP relay is a service that accepts email from your app and delivers it on your behalf. It handles the hard parts — authentication with email providers, retry logic, spam reputation management, delivery tracking.
You could technically send email directly from your server, but most email providers would mark it as spam. Relays like Resend have established trust with Gmail, Outlook, and others, so your emails actually arrive.
Your app uses Nodemailer, a Node.js library that speaks SMTP. The SMTP_CONFIG environment variable tells Nodemailer where to send emails:
{
"host": "smtp.resend.com",
"port": 465,
"secure": true,
"auth": { "user": "resend", "pass": "re_YOUR_API_KEY" }
}
Nodemailer connects to Resend's SMTP server, authenticates with your API key, and hands off the email for delivery. Resend does the rest.