> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.mysmtp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Supported SMTP Ports and Encryption

> Learn which SMTP ports and encryption methods mySMTP supports, including SSL/TLS vs STARTTLS, and why port 587 with STARTTLS is recommended.

When setting up an SMTP server for sending emails, selecting the right **port** and **encryption method** is crucial. SMTP supports multiple ports and encryption protocols to ensure secure and reliable email transmission.

## 1. What Are SMTP Ports?

SMTP ports are **communication gateways** that allow email clients and servers to exchange messages. Different ports serve different purposes, and choosing the correct one improves **deliverability, security, and compliance** with modern email standards.

### Common SMTP Ports and Their Usage:

| Port | Encryption Type | Usage |
| - | - | - |
| 25 | None (Plaintext) | Traditional SMTP, mostly blocked by ISPs |
| 465 | SSL/TLS | Secure SMTP (SMTPS), used for encrypted email transmission |
| 587 | STARTTLS | Recommended for secure email sending with authentication |

## 2. Understanding SMTP Encryption: SSL/TLS vs. STARTTLS

### SSL/TLS (Port 465)

**SSL/TLS (Secure Sockets Layer / Transport Layer Security)** encrypts the SMTP connection from the start, ensuring **end-to-end encryption**. This method prevents **man-in-the-middle attacks** by securing the entire communication session. Used by services that require **strict encryption** before sending emails.

### STARTTLS (Port 587 – Recommended)

STARTTLS is an **opportunistic encryption method** that upgrades an unencrypted connection to an encrypted one. Ensures secure email transmission **without requiring a dedicated encrypted port**. Most modern mail servers, including Gmail and Outlook, recommend **port 587 with STARTTLS**.

### Difference Between SSL/TLS and STARTTLS:

| Encryption Method | Encryption Timing | Recommended Use |
| - | - | - |
| SSL/TLS (465) | Encryption starts immediately | Legacy secure SMTP, older systems |
| STARTTLS (587) | Upgrades connection to encrypted | Modern, flexible, widely recommended |

## 3. Which SMTP Port Should You Use?

### Recommended: Port 587 (STARTTLS)

* **Best for outgoing email** from email clients, applications, and SMTP relay services.
* **Supports authentication** and **encryption**, improving email security and deliverability.
* **Widely supported** by major providers like Gmail, Outlook, and mySMTP.

### Avoid Using Port 25 for Sending Emails

* Port **25 is primarily for server-to-server email relay** (MTA to MTA communication).
* Many ISPs block **outbound traffic on port 25** to prevent spam.
* If you are sending emails from an email client or web application, **use 587 instead**.

### When to Use Port 465 (SSL/TLS)

* If your **email provider requires SSL/TLS**, port **465 is an alternative** to 587.
* **Not officially recognized** for SMTP by IETF but still used by some services.

## 4. How to Configure Your SMTP with the Right Port and Encryption

To configure your email client or application, use the following recommended settings:

* **SMTP Server:** smtp.yourdomain.com
* **Port:** 587 (STARTTLS) or 465 (SSL/TLS)
* **Encryption:** **STARTTLS (recommended) or SSL/TLS**
* **Authentication Required:** **Yes**
* **Username & Password:** Use your SMTP credentials

## 5. Testing Your SMTP Connection

Before sending emails, test your SMTP setup to ensure proper configuration.

Use [**test.smtp.ai**](https://test.smtp.ai) to verify:

* Port connectivity (**25, 465, 587**)
* Encryption method (**STARTTLS, SSL/TLS**)
* Authentication (**SPF, DKIM, DMARC**)

## 6. Conclusion

Choosing the correct **SMTP port and encryption method** is key to **secure and reliable** email sending.

* **Use port 587 with STARTTLS** for best security and deliverability.
* **Port 465 with SSL/TLS** is an alternative but less widely recommended.
* **Avoid port 25 for sending emails** — it is often blocked by ISPs.

For troubleshooting and testing, use [**test.smtp.ai**](https://test.smtp.ai) to confirm your SMTP setup is working correctly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.