---
title: "SMTP Port 587 vs 25: Which Port to Use for Email Sending | SendHQ"
description: Technical comparison of SMTP ports 25 and 587. Learn why port 587 is the standard for client submission and port 25 is for server relay.
canonical: https://sendhq.cc/terms/smtp-port-587-vs-25
last-updated: 2026-08-26
---
# SMTP Port 587 vs 25: Which Port to Use for Email Sending

Use port 587 for submitting emails from a client or application to a mail server. Port 25 is reserved for server to server relay and is frequently blocked by Internet Service Providers to prevent spam. Port 587 supports STARTTLS for secure encryption and is the modern standard for message submission.

## Port 587 for Message Submission

Port 587 is the designated port for email submission. It is used by mail clients like Outlook or custom applications to send mail to an SMTP server. This port typically requires authentication and uses the STARTTLS command to upgrade a plain text connection to a secure TLS encrypted session. Because it is the standard for submission, it is rarely blocked by ISPs, making it the reliable choice for developers. SendHQ provides free tools at https://sendhq.cc/tools to help verify your email configuration.

## Port 25 for Server Relay

Port 25 is the original SMTP port used for relaying mail between Mail Transfer Agents. When one mail server sends a message to another, it uses port 25. However, because of the high volume of spam originating from compromised home computers and unauthenticated scripts, most residential and cloud providers block outbound traffic on port 25. Attempting to use port 25 for application submission often results in connection timeouts.

## Security and Encryption Differences

Port 587 is designed to work with STARTTLS, which allows the client and server to negotiate a secure connection after the initial handshake. Port 25 can also support STARTTLS, but it is often used for unencrypted traffic in legacy systems. For implicit TLS, port 465 is sometimes used, though port 587 remains the IANA recommended standard for submission. Using port 587 ensures that authentication is handled correctly before the mail is accepted for delivery.

## Choosing the Right Port

If you are writing code in Python, Node.js, or using a library to send transactional emails, always start with port 587. Only use port 25 if you are configuring a full mail server intended to receive mail from other servers on the internet. If your application cannot connect via 587, check your firewall settings or cloud provider security groups to ensure outbound traffic is permitted on that specific port.

## Questions teams ask

**Why is port 25 blocked?**

ISPs block port 25 to stop spam bots from sending millions of emails directly from infected devices without using a legitimate mail server.

**Is port 587 secure?**

Yes, port 587 uses STARTTLS to encrypt the communication between the client and the server, protecting credentials and message content.

**Can I use port 465 instead?**

Port 465 was originally for SMTPS (implicit TLS). While still common, port 587 is the current standard for submission via STARTTLS.

## Primary sources

- [RFC 5321: Simple Mail Transfer Protocol](https://www.rfc-editor.org/rfc/rfc5321) — RFC Editor
- [RFC 3207: SMTP Service Extension for Secure SMTP over Transport Layer Security](https://www.rfc-editor.org/rfc/rfc3207) — RFC Editor
- [Service Name and Transport Protocol Port Number Registry](https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml) — IANA

## Continue learning

[smtp port](https://sendhq.cc/guides/smtp-port.md) [mail protocol smtp](https://sendhq.cc/guides/mail-protocol-smtp.md) [smtp relay service](https://sendhq.cc/guides/smtp-relay-service.md) [free smtp service](https://sendhq.cc/guides/free-smtp-service.md)
