What is the difference between secure submission (587) and relay (25)?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

You've probably seen "port 587" and "port 25" in your SMTP settings and wondered what the difference is. Here's the short version: Port 587 is for you sending email (authenticated submission). Port 25 is for mail servers talking to each other (relay).

Port 25 came first. It's the original email port, designed for mail servers to pass messages between each other. When you send an email, your server uses port 25 to hand it off to the recipient's server. No authentication required (historically). This worked fine when the internet was small and trusted.

Then spam happened. Spammers loved port 25 because they could blast email directly from infected home computers without authenticating. ISPs started blocking outbound port 25 from residential connections to stop this. That's why if you try to send email through port 25 from your laptop at a coffee shop, it won't work.

Port 587 was created specifically for authenticated submission. When you configure Mailchimp, SendGrid, or any ESP in your app, you're using port 587. It requires you to log in with credentials before it accepts your email. Modern email clients (Gmail, Outlook, Apple Mail) default to port 587 for outgoing mail.

The practical difference: Port 25 is server-to-server, no authentication, often blocked by ISPs. Port 587 is you-to-server, requires authentication, works everywhere. If you're configuring SMTP settings for an application or email client, use 587. If you're running a mail server that receives email from other mail servers, you'll listen on 25.

One more thing: port 587 should use STARTTLS encryption. Port 25 historically didn't require encryption (though modern servers use it when available). Some providers also use port 465 for SMTPS (SMTP wrapped in TLS from the start), but 587 with STARTTLS is the current standard.

And if you're stuck configuring this, check your ESP's documentation or ask our SOS hotline. Wrong port = emails don't send, and that's a quick fix once you know which one to use.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Get port configuration help for your setup

I read this on the Email Almanac about port 587 vs port 25: "Port 587 is for authenticated submission (you sending email). Port 25 is for server-to-server relay. Port 587 requires credentials and works everywhere. Port 25 is often blocked by ISPs for outbound residential connections." Help me figure out the right configuration for MY setup: 1. Which port should I use for my sending scenario? 2. Why might my current port choice be causing problems? 3. What SMTP settings should I check or change? 4. How do I verify it's working correctly? --- My details: - Email platform/ESP: e.g. SendGrid, Mailgun, Postmark, custom SMTP server - What I'm sending: transactional emails, marketing campaigns, app notifications - Current SMTP port: 25, 587, 465, or not sure - Error/symptom: emails not sending, connection refused, timeout - Hosting environment: AWS, DigitalOcean, shared hosting, local development - Experience level: beginner / intermediate / advanced

Edit the yellow boxes, then send to the AI of your choice.