---
title: "SMTP port 587 vs. 465: Which port should you use?"
description: "Choosing the wrong SMTP port can cause authentication failures, bounced emails, and security vulnerabilities. Port 587 with StartTLS is the standard submission port and the recommended default for most setups, as connections start unencrypted and upgrade to secure. Port 465 uses implicit TLS, meaning encryption begins immediately, and it is an official submission port again after years of being labeled deprecated. Port 25 should be avoided for client applications because most ISPs block it, while port 2525 serves as an unofficial alternative when standard ports are blocked. For new configurations, use port 587 with StartTLS, falling back to port 465 only if compatibility issues arise."
---

# SMTP port 587 vs. 465: Which port should you use?

[Twilio](https://yomu.fyi/company/twilio) · Jesse Sumrak, David Blum · Nov 14, 2026

**Type:** Explainer

## Summary

Choosing the wrong SMTP port can cause authentication failures, bounced emails, and security vulnerabilities. Port 587 with StartTLS is the standard submission port and the recommended default for most setups, as connections start unencrypted and upgrade to secure. Port 465 uses implicit TLS, meaning encryption begins immediately, and it is an official submission port again after years of being labeled deprecated. Port 25 should be avoided for client applications because most ISPs block it, while port 2525 serves as an unofficial alternative when standard ports are blocked. For new configurations, use port 587 with StartTLS, falling back to port 465 only if compatibility issues arise.

## Context

The post explains the difference between SMTP ports 587 and 465 for email submission, covering when to use each, their security models (StartTLS vs. implicit TLS), and configuration examples for Gmail, Outlook, and Twilio SendGrid.

## Takeaways

- Port 587 with StartTLS is the standard submission port and should be the default for email clients and transactional email applications.
- Port 465 uses implicit TLS (encrypted from the first packet) and is an official submission port again, suitable when port 587 is blocked or legacy systems require it.
- Port 25 is for server-to-server relay and is typically blocked by ISPs; port 2525 is an unofficial alternative that works like port 587 on a different number.

## FAQ

### Which SMTP port is most secure?

Both are equally secure when properly configured. The difference is in how encryption is established, not the level of security provided.

### Can I use port 25 for sending emails?

Port 25 is for server-to-server relay and many ISPs block it. Use port 587 or 465 for client applications instead.

### What if my ISP blocks all SMTP ports?

Try port 2525, which many email providers support as an alternative. If that fails, use your ISP's SMTP server or switch to an API-based email service.

**Tags:** [Email](https://yomu.fyi/topic/email), [Security](https://yomu.fyi/topic/security), [SMTP](https://yomu.fyi/topic/smtp), [TLS](https://yomu.fyi/topic/tls)

- Source: [Twilio](https://www.twilio.com/en-us/blog/insights/whats-the-difference-between-ports-465-and-587)
- Source URL: https://www.twilio.com/en-us/blog/insights/whats-the-difference-between-ports-465-and-587
- Ingested by Yomu: 2026-11-18T18:01:14.010Z

[Read original post](https://www.twilio.com/en-us/blog/insights/whats-the-difference-between-ports-465-and-587)
