Table of Contents
- Port 587 vs 465 at a Glance
- What do SSL and TLS mean in a settings screen?
- Is Port 465 More Secure Than Port 587?
- Where does the STARTTLS risk sit?
- What must a secure client validate?
- Where Port 25 Fits and Why It Is Often Blocked
- Why does a connection time out?
- How to check the receiving hosts
- Documented Ports for Microsoft 365, Gmail, Amazon SES and SendGrid
- Which account rules matter?
- How to verify it
- How to Check Which Ports Answer With mailX
- What should the administrator enter?
- What does each stage establish?
- What does a partial failure rule out?
- Common Mistakes That Break Port and Encryption Pairs
- Which errors aren't port problems?
- How to verify it
- Questions About Alternate Ports and Port Changes
- Is port 2525 a replacement for port 587?
- Does changing the SMTP port require a DNS change?
- Can one account use both submission modes?
- Choose the Port Your Provider Documents for Your App
- How to verify it
Do not index
Do not index
Port 587 is authenticated submission with STARTTLS, port 465 is submission over implicit TLS (SMTPS, re-standardized by RFC 8314), and port 25 is server-to-server relay that most apps shouldn't use. Port 465 isn't automatically more secure than port 587: the client's requirement for successful, validated TLS matters more than the port number.
Most failures in a port 587 vs 465 setup come from mismatched encryption modes, blocked connections, or authentication policies. Changing the number without changing the matching TLS mode often replaces one error with another.
Table of Contents
Port 587 vs 465 at a GlanceWhat do SSL and TLS mean in a settings screen?Is Port 465 More Secure Than Port 587?Where does the STARTTLS risk sit?What must a secure client validate?Where Port 25 Fits and Why It Is Often BlockedWhy does a connection time out?How to check the receiving hostsDocumented Ports for Microsoft 365, Gmail, Amazon SES and SendGridWhich account rules matter?How to verify itHow to Check Which Ports Answer With mailXWhat should the administrator enter?What does each stage establish?What does a partial failure rule out?Common Mistakes That Break Port and Encryption PairsWhich errors aren't port problems?How to verify itQuestions About Alternate Ports and Port ChangesIs port 2525 a replacement for port 587?Does changing the SMTP port require a DNS change?Can one account use both submission modes?Choose the Port Your Provider Documents for Your AppHow to verify it
Port 587 vs 465 at a Glance
SMTP submission is the connection an application or email client uses to hand outbound messages to its sending provider. SMTP relay is the subsequent transfer between mail servers. Those are different jobs, even though both use Simple Mail Transfer Protocol.
In practice, a mail server uses the relay port to reach another domain's receiving server. An application uses the STARTTLS submission port when its SMTP library supports an explicit encryption upgrade. An implicit-TLS client starts encryption immediately and must connect to the corresponding submission service.
What do SSL and TLS mean in a settings screen?
A setting labeled SSL commonly means implicit TLS, not permission to use obsolete SSL protocols. A setting labeled TLS is less precise: some clients mean STARTTLS, while others mean implicit TLS. The application's documentation must identify when encryption begins.
For readers separating sending from mailbox access, the Nerds 2 You Edmonton email guide explains the distinction between SMTP, IMAP, and POP. Changing a receiving-mail setting won't repair an outbound SMTP mismatch.
The provider's documented pair decides the choice. Available endpoints and authentication policies can change by region, plan, or account configuration, so administrators should confirm the current values in the provider's official documentation.
Before saving a setting, administrators can run the mailX SMTP test on both documented submission ports, using the correct encryption mode for each.
Is Port 465 More Secure Than Port 587?
Port 465 and port 587 provide equivalent submission security when the client requires successful TLS, validates the server certificate, and refuses to send credentials or mail before encryption succeeds. The important difference is when the TLS handshake begins.
The IANA submission service registry associates implicit-TLS submission with RFC 8314 and STARTTLS submission with RFC 6409; RFC 8314 describes no significant security-property difference when both implementations require TLS and recommends supporting both mechanisms during transition.

Where does the STARTTLS risk sit?
A STARTTLS connection begins with an unencrypted SMTP greeting. The client sends
EHLO, checks the server's capabilities, and requests STARTTLS. After a successful handshake, the client sends EHLO again inside the encrypted session before proceeding with authentication.A client that treats encryption as optional can mishandle a missing STARTTLS advertisement or failed upgrade. A correctly configured submission client stops instead of continuing with credentials or message content. An attacker might still cause a connection failure, but shouldn't be able to force that client into plaintext submission.
Implicit TLS removes that SMTP upgrade phase. The client and server negotiate TLS before exchanging an SMTP greeting, eliminating STARTTLS-stripping mistakes from that connection path.
What must a secure client validate?
Neither mode repairs an incorrect server identity or a permissive certificate configuration. Both need the same safeguards:
- Certificate chain: The certificate must validate against a trusted certificate authority.
- Hostname: The configured SMTP hostname must match the certificate's permitted names.
- Authentication boundary: The client must require TLS before sending
AUTHcredentials.
- Protocol policy: The client and server must support current TLS settings without falling back to obsolete protocols.
Disabling certificate verification to make a connection work removes an essential protection. Connecting by a provider's documented hostname is preferable to substituting an IP address or an unrelated domain.
The relationship between transport protection and message handling is explained further in email encryption and inbox placement. A successful encrypted connection protects that SMTP hop; it doesn't establish that every later hop or stored message has equivalent protection.
Where Port 25 Fits and Why It Is Often Blocked
Port 25 carries mail between servers rather than serving as the login endpoint for applications, and confusing the two roles is the mismatch behind many blocked connections. RFC 6409's publication history records its publication as an Internet Standard in November 2011, establishing port 587 for submission while keeping server-to-server relay on port 25.
That separation lets a submission provider authenticate users, authorize senders, and enforce account-specific limits without requiring unrelated receiving servers to behave like logged-in clients.
Why does a connection time out?
Run the check from the machine that fails. Connect to the receiving domain's MX host on port 25 with
openssl s_client -connect mx.example.com:25 -starttls smtp, or a plain telnet mx.example.com 25, first from a laptop on a residential connection and again from a cloud VM. A banner or TLS handshake on one network and a timeout on the other isolates the egress policy as the cause, because the destination demonstrably answered elsewhere. Identical timeouts on both point back at the server side instead.A timeout alone still doesn't prove a network block. A wrong hostname, routing problem, server firewall, or unavailable listener produces the same symptom, so confirm the MX hostname before blaming the network.
The same probes settle hosting for self-hosted business software questions before deployment: test outbound port 25 and the documented submission port from a trial instance, or ask the provider which egress rules apply. A host that blocks 25 but permits 587 and 465 still works for authenticated submission. Even so, it cannot relay directly to other servers' MX hosts.
How to check the receiving hosts
An MX lookup for the receiving domain confirms its published inbound mail hosts. A good result identifies the expected receiving infrastructure; missing or unexpected MX records indicate an inbound-routing issue, not a reason to change an application's submission port.
The application's outgoing server should remain the provider's documented submission hostname. An MX host isn't automatically the correct SMTP login host, even when both services belong to the same provider.
Documented Ports for Microsoft 365, Gmail, Amazon SES and SendGrid
Provider documentation, not a generic default, determines the submission settings. These documented configurations need confirmation against the provider's current setup guide because regional endpoints, account eligibility, and authentication policies can change.
Which account rules matter?
Microsoft 365: Enabling SMTP AUTH for a mailbox doesn't override every organization-wide restriction. The client must also use an authentication method that the tenant currently permits. Administrators should check Microsoft Learn's current rules and the Office 365 SMTP port and encryption guide before treating a rejected password as a port problem.
Gmail and Google Workspace: A normal account password isn't interchangeable with an app password. App-password availability depends on account security settings and administrator policy; some environments require an OAuth-capable client instead.
Amazon SES: The region placeholder must be replaced with the actual sending region. SMTP credentials and endpoint selection must match the intended regional setup.
SendGrid: The login name is the literal value shown in the table, not the account's email address. The API key must have the permissions required for sending.
How to verify it
The SMTP Finder returns outgoing-server settings, ports with encryption, login details, and the provider's setup guide without asking for credentials. Administrators can use the returned guide to confirm the account's supported configuration, then run the SMTP test against that pair.
A good result shows the documented host answering, followed by successful encryption and authentication. A timeout points toward reachability or endpoint availability; a handshake error points toward TLS mode, certificate validation, or protocol compatibility. Neither result alone establishes that the password is wrong.
How to Check Which Ports Answer With mailX
The SMTP test checks which endpoint answers and whether the selected encryption mode can complete a real login. Read connection, encryption, and authentication as three separate verdicts rather than one pass-or-fail stamp.
What should the administrator enter?
- Find the provider's outgoing hostname and supported port/encryption pairs using SMTP Finder. The incoming MX hostname shouldn't be substituted unless the provider explicitly documents it for submission.
- Open the tool to test SMTP ports. Enter the provider's hostname, the selected port, and the matching encryption mode.
- Provide credentials only when explicitly requesting a login test for a mail account under the administrator's control. Use the credential type the provider requires, such as an app password or service-specific SMTP password. The password is used only to run the test and is redacted before the request is saved.
- Test each documented submission pair independently. Change both the port and encryption mode when switching between STARTTLS and implicit TLS.
- Supply a sender and recipient address when a full end-to-end check is needed. With both fields set, the tool sends one test email after authentication, which confirms the server accepts a message rather than only a login.
- Read the connection, encryption, and authentication results separately. Stop changing network settings once the failure has clearly moved to account authentication.
A run against Gmail's submission host might return connection success, encryption success, then an authentication rejection. That pattern clears the port, the TLS mode, and the certificate in one pass, leaving credentials or account policy as the only remaining suspects. An application's generic “SMTP error” label can't narrow the problem that far.

What does each stage establish?
- Connection success: The testing environment reached a listening service at that hostname and port. It hasn't yet proved encryption or login works.
- Encryption success: The selected TLS workflow completed, meaning the mode matched the listener and certificate validation passed. Authentication can still fail afterward.
- Authentication success: The server accepted the supplied credentials under its current policy. That doesn't guarantee acceptance of every sender address or message.
A hosted test runs from the tool's network, not from the application server. If the hosted test succeeds while the application times out, administrators should investigate the application environment's egress firewall, DNS resolution, proxy, or routing.
When one port answers and another fails on the same hostname, the cause sits with a port-specific listener or a network policy. Retest both documented pairs before assuming the endpoint itself is down.
What does a partial failure rule out?
A good result shows connection, encryption, and authentication succeeding on the provider's documented pair. A failed handshake requires checking the selected mode, hostname, certificate trust, and supported TLS settings before changing credentials.
For a suspected local block, test the application from its actual deployment environment. An external success is useful evidence that the provider is reachable, but it can't prove the application's network permits the same connection.
Common Mistakes That Break Port and Encryption Pairs
The most direct failures happen before authentication: an implicit-TLS client reaches a STARTTLS listener, or a STARTTLS client reaches an implicit-TLS listener. Both can produce errors that an application incorrectly summarizes as a login failure.
Which errors aren't port problems?
A certificate-name mismatch isn't fixed by disabling verification. The general hostname-and-certificate relationship also appears in AppJet's guide to secure custom domains with SSL, although a website certificate installation doesn't configure an SMTP endpoint.
Duplicate SPF records, exceeding the SPF DNS-lookup limit, a wrong DKIM selector, or publishing CNAME where TXT is required can break domain authentication. Those mistakes don't explain a failed TCP connection or TLS handshake, and the SMTP test isn't a DNS-authentication validator. DKIM record type must follow the sending provider's instructions because providers can legitimately use either TXT-based keys or CNAME delegation.
The SMTP test reports the connection stage that failed. When both
from_email and to_email are supplied to the endpoint, it also sends a test message; login-only diagnosis shouldn't accidentally become a sending test.How to verify it
After correcting the identified setting, administrators should rerun the SMTP test with the same hostname and intended account. A successful handshake followed by rejected authentication points toward credentials, authentication mechanism, or provider policy, not a need to switch ports.
A handshake failure calls for checking more than the pair alone. Certificate expiry, trust-chain problems, incorrect system time, and unsupported TLS settings can also prevent encryption even when the port and mode match.
Questions About Alternate Ports and Port Changes
Is port 2525 a replacement for port 587?
Port 2525 isn't the registered SMTP submission port; it's a provider-supported alternative in some services. SendGrid documents it as an alternative using STARTTLS, useful when the normal submission endpoints aren't reachable, but administrators should confirm the current supported list in SendGrid's official setup documentation rather than assume another provider accepts it.
Does changing the SMTP port require a DNS change?
Changing the SMTP port doesn't require a DNS change because the application stores the port and encryption settings, not the domain's DNS records. Moving between submission modes leaves SPF, DKIM, and DMARC untouched when the sending infrastructure stays the same; changed authentication results need separate investigation rather than speculative DNS edits.
Can one account use both submission modes?
An account can use both modes when its provider documents both endpoints and permits the account's authentication method on each. Each application needs a complete, internally consistent hostname, port, and encryption configuration; administrators should test the pairs independently because a working login on one endpoint doesn't establish that another endpoint has identical policies.
Choose the Port Your Provider Documents for Your App
The IANA implicit-TLS submission registration identifies port 465 as submission over TLS under RFC 8314. It's a current submission option, not a deprecated workaround.

- One documented pair: Use that pair because the provider controls endpoint policy.
- Both modes supported: Choose the mode the application library supports directly and can enforce securely.
- STARTTLS-only library: Use the documented STARTTLS endpoint.
- Implicit-TLS-only library: Use the documented implicit-TLS endpoint.
- Relay-port temptation: Don't configure ordinary application submission against a server-to-server relay endpoint.
Neither submission port delivers messages faster by nature. Network round trips, connection pooling, TLS session reuse, certificate validation, server processing, and queueing determine practical latency.
How to verify it
Before saving the application configuration, confirm the provider's pair and require successful connection, encryption, and authentication.
An agent using MCP access must obtain explicit confirmation before invoking a credential-based login test. The
smtp_check and imap_check tools have readOnlyHint set to false because they log in with submitted credentials, and the SMTP tool can send a test email; these login tests aren't available in the ChatGPT app or read-only agent toolsets.mailX is a free email diagnostics toolkit from Mailwarm Inc. (YC S20), with live checks and plain-English fixes for email authentication, DNS, and SMTP/IMAP connectivity. Run the SMTP test, free with no signup required, to verify the provider's hostname, port, encryption mode, and login before saving the application settings.
