Skip to main content

SMTP ports: 25, 465, 587 and 2525

To send email from an app, use port 587 with STARTTLS or port 465 with SSL/TLS. Port 25 is for mail servers talking to each other, and is usually blocked.

SMTP port numbers

PortSecurityUsed for
25STARTTLS (optional)Server-to-server delivery (MX). Blocked for outgoing traffic by most ISPs and cloud hosts.
587STARTTLSSending from apps and mail clients (submission). The default choice.
465SSL/TLS (implicit)Sending from apps and mail clients, encrypted from the first byte. Recommended by RFC 8314.
2525STARTTLSUnofficial fallback offered by sending services when 587 is blocked.

SMTP port 25

Port 25 is the original SMTP port, and it is still how mail servers deliver to each other: when Gmail sends to Outlook, it connects to Outlook's MX server on port 25. It is not meant for apps sending through their provider.

Because spam bots abused it, most home ISPs and cloud providers block outgoing port 25, including AWS, Google Cloud, Azure and Cloudflare Workers. If your app connects on 25 and times out, that block is almost always the reason. Switch to 587 or 465 and log in to your provider. This tester blocks port 25 for the same reason.

STARTTLS vs SSL/TLS

Both give you the same TLS encryption. They differ in how the connection starts:

  • SSL/TLS (implicit TLS, port 465): the client opens an encrypted connection straight away, then speaks SMTP inside it.
  • STARTTLS (port 587, also 25 and 2525): the client connects in plain text, the server lists STARTTLS as a capability, and the client asks to upgrade before sending the password.

RFC 8314 (2018) recommends implicit TLS on 465 because a STARTTLS upgrade can be stripped by an attacker on the network if the client doesn't insist on it. Any modern mail library insists, so 587 is safe too. What breaks connections is a mismatch:

  • SSL/TLS on port 587: the client sends a TLS handshake, the server expects a plain greeting, and the connection fails with a TLS or "wrong version number" error.
  • STARTTLS on port 465: the client waits for a plain greeting, the server waits for a TLS handshake, and the connection times out.

More background in what is SSL email.

Test an SMTP port

Pick a port and security mode. The test shows whether the port answers, whether TLS works, and whether your login is accepted.

Your password is used for this one test and never stored or logged. We send one fixed test message; you can't change its content.

What this checks

  1. 1. Connect to server
  2. 2. Secure connection (TLS)
  3. 3. Log in
  4. 4. Send test email

If a step fails you get the server's exact reply and what it usually means.

Ports by provider

  • Gmail: 587 STARTTLS or 465 SSL/TLS
  • Outlook and Microsoft 365: 587 STARTTLS only
  • Yahoo, Zoho: 465 SSL/TLS (587 also works)
  • SendGrid, Mailgun, Brevo: 587, 465 or 2525
  • Amazon SES: 587 or 465 (also 2587 and 2465)

FAQ

What is the SMTP port number?
Use 587 with STARTTLS to send from an app or mail client, or 465 with SSL/TLS if your provider lists it. Port 25 is the original SMTP port, used between mail servers.
Why is SMTP port 25 blocked?
Infected computers used port 25 to send spam straight to mail servers, so most ISPs and cloud providers (AWS, Google Cloud, Azure, Cloudflare Workers) block outgoing connections to it. Send on 587 or 465 through your provider instead.
Should I use port 587 or 465?
Either is fine for sending; both end up encrypted. 465 encrypts from the first byte, 587 upgrades with STARTTLS. Use what your provider documents and set the matching security mode.
What is the difference between STARTTLS and SSL/TLS?
SSL/TLS (implicit TLS) starts the encrypted connection immediately, on a dedicated port such as 465. STARTTLS connects in plain text on a normal port such as 587, then upgrades to TLS before login. The encryption is the same; only the start differs.
Is port 2525 a real SMTP port?
It isn’t an official one, but SendGrid, Mailgun, Brevo and other sending services accept it because some networks block 587. Use it with STARTTLS when 587 times out.
How do I check if an SMTP port is open?
Run the test on this page with your server and port. A timeout means the port is blocked or closed; an error from the server means the port is open and the problem is the settings or login.