SMTP Port 465 vs 587: Which One Should You Use?
Use port 465 with implicit TLS or port 587 with STARTTLS when your mail provider supports it. Learn how to match the port and security setting and diagnose common connection errors.
Use 465 with implicit TLS or 587 with STARTTLS, according to your mailbox provider's instructions. Both can encrypt the connection from your email app to its outgoing mail server. They start encryption at different points in the connection, so changing only the port can leave an otherwise correct account unable to send. Read the server name, port and security mode together before touching the password.
What the port number tells your email app
SMTP is the protocol many desktop email apps use to hand a message to the provider that will send it. The server name tells the app which machine or service to reach. The port tells it which service to connect to there. The encryption setting tells it how to establish an encrypted connection to that service. Each value answers a different question.
Think of a provider that publishes two valid configurations for the same hostname. One reads 465, SSL/TLS. The other reads 587, STARTTLS. Either line can be a complete configuration. Taking the port from the first line and the security mode from the second makes a third configuration that the provider never advertised. The app and server then expect different first steps. An error can arrive before either side has asked for a login.
The email address itself reveals little about the port. If your mailbox is alex@example.com, a hosting company might supply an outgoing server under its own domain. A work organisation might route submissions through a separate service from the one that receives email. Two addresses with different domains can share infrastructure, while two services at a single provider can have different setup requirements. Use the values for the particular mailbox and account type.
The same idea applies when you're copying a configuration from another app. A dropdown marked SSL/TLS may describe implicit TLS, and one marked STARTTLS usually describes an upgrade. A single Use SSL switch is less clear. Consult the app's own help if it can't show you how that switch maps to the provider's instructions. A successful result comes from the combination, even when different apps use different labels for it.
| Provider's settings say | Choose in the email app | How encryption begins |
|---|---|---|
| Port 465, implicit TLS or SSL/TLS | 465 with implicit TLS | The encrypted connection is negotiated first |
| Port 587, STARTTLS | 587 with required STARTTLS | SMTP begins, then upgrades to TLS before authentication |
| Another port or a managed account setup | The exact option documented for the account | Follow the provider's instructions |
How port 465 starts encryption
With implicit TLS, the app opens a network connection to port 465 and starts the TLS handshake immediately. The server presents a certificate during that handshake. The app checks the certificate for the hostname it was configured to reach and verifies that it trusts the certificate chain. SMTP conversation takes place inside the encrypted connection after those checks.
This order explains why a certificate error and a bad password error are different. If you see a warning that the certificate belongs to a different server, the app has reached a network service and received a certificate, but it hasn't successfully established the trusted session it needs to log in. Correcting the server name or asking the provider to check the certificate addresses that evidence. Resetting your email password leaves the certificate comparison exactly where it was.
There is some historical terminology in app settings. A provider may say SSL, SSL/TLS, TLS, or implicit TLS when it describes the encrypted port. Modern deployments use TLS. The older word SSL often survives in the menu label. Pair the wording with the port and the provider's setup example. The useful distinction here is that encryption starts before any SMTP greeting reaches the app.
Suppose you configure port 465 but choose STARTTLS. The app may wait for the mail server's greeting, expecting to request the upgrade later. The server instead waits for the app to begin the TLS handshake. The waiting can look like a plain timeout. Other software may return a protocol or handshake error. The precise wording varies, which is why checking the pair is quicker than searching a broad phrase such as “SMTP server failed”.
How port 587 and STARTTLS work
With STARTTLS, the app connects and has an initial SMTP exchange. The server announces whether it supports STARTTLS. The app requests the upgrade, negotiates TLS and verifies the certificate. After the upgrade, it learns the available SMTP features over the encrypted connection. It can then authenticate and submit the message.
The exchange before the upgrade includes protocol information. A properly configured app keeps credentials and message contents for the protected part of the session. When the provider requires STARTTLS, configure it as required in the app if the app distinguishes required TLS from opportunistic encryption. Required mode means a missing upgrade, failed handshake or invalid certificate stops the submission.
Connecting with implicit TLS to a STARTTLS port reverses the first steps. The app begins a TLS negotiation while the service expects its ordinary greeting and SMTP commands first. You might see an error about a wrong protocol version even when both sides support a compatible version of TLS. The error can reflect the way the connection started. Check the port and mode before assuming you need to change operating systems, install a certificate or replace the account.
Port 587 is the standard submission port described by the mail submission specification. RFC 8314 also specifies implicit TLS submission on 465 and recommends it for mail submission where supported. Providers can keep both services available. An older account setup and a new account setup can therefore be valid at the same time, provided each uses its own complete configuration and enforces TLS.
Which port is more secure
Both modes can protect an email submission when the client requires TLS, validates the server certificate and authenticates only inside the encrypted session. The important comparison is between the options the provider actually supports. A known working port with the correct security policy is a sound choice. Changing it solely because a larger or smaller port number sounds more secure solves nothing measurable.
Implicit TLS has a simple property: the application protocol begins after the connection is encrypted. STARTTLS needs a successful upgrade during the protocol exchange. When that upgrade is required and verified, the credentials and message are protected on the same link. If an app instead offers to continue in cleartext when the upgrade fails, that option changes the security outcome. Choose a setting that stops the connection when protection can't be established.
Certificate checking matters in both modes. The certificate ties the connection to the name your app intended to reach. If your provider publishes smtp.provider.example and its certificate covers that name, an address you guessed under your own domain can raise a warning even when both resolve to the same service. Replace the guessed server name with the documented one. For a managed work address, the administrator can confirm the correct hostname and whether devices need a deployed trust configuration.
TLS in this guide protects the hop between the email app and that submission server. Later transfers and storage have their own security settings. The port you chose does not determine what happens after the message leaves your provider. It also has no effect on how old messages are encrypted on your PC or whether the recipient can forward what they receive.
When port 25 or a different port appears
Port 25 commonly carries SMTP between mail servers. A consumer internet connection or workplace network may block outbound access to it to limit abuse. Desktop mail providers typically publish a submission port instead. If an old printer manual, forum answer or exported configuration points to port 25, confirm the exact service and current instructions before using it.
An organisation may operate a relay for an authorised application or managed device. That relay can use different connection rules, such as source network restrictions and different authentication requirements. Instructions for the organisation's relay belong to that workflow. The mailbox account you use in a desktop app may have a separate authenticated submission service with a different port.
Some providers publish another port as a fallback. Use it when the provider explicitly lists the matching hostname and encryption mode and your app supports that combination. Numbers alone give little information about how a privately configured service behaves. An “alternative SMTP port” from an unrelated brand cannot be assumed to work at your provider.
When a company controls the network and the mailbox, its help desk may want to compare the network policy with the published account settings. Record the time and the network on which the failure happened. Changing to an approved working network for one test can be informative. Keep the same account and the same documented encryption mode for the comparison so that the network is the variable you’re testing.
Isolate the failure before changing more settings
Look at when the send fails. A name resolution error points to the hostname or the system's ability to resolve it. A connection timeout can mean that the named service was unreachable on that network or that the app and server expected different starts. A certificate error occurs during the encrypted connection. An authentication failure comes later, after the app has reached a service far enough to attempt signing in. A rejected sender address or recipient is later still.
These are starting points and some apps collapse several errors into one notification. Open the available details or account test result before classifying it. For example, “Could not send” beside a recipient whose address is incomplete tells you less than a message that says authentication failed. A webmail send can isolate the desktop path, but it uses the provider's own application and may bypass its external submission service.
Consider a laptop that sends through the same mailbox at the office and fails at a hotel. The authentication method and account have already worked together, and the app hasn't changed. Complete any hotel's sign-in page in your browser and try the published settings once. If the account works when you reconnect to a known approved network, report the difference to your provider or administrator. Replacing an app password while the network connection is blocked can create a second failure and obscure the first.
If the mailbox fails on every network immediately after a provider migration, the timeline suggests a different check. Compare the current provider's hostname and settings with the old ones, including credentials and any sign-in policy. Your From address could have stayed identical while the server changed. Incoming IMAP and outgoing SMTP settings can also change at different points in a migration, so a working inbox does not settle the outgoing configuration.
When the certificate belongs to another name
Record the name shown in your outgoing settings and the name the app reports from the certificate. A hosting company may tell you to use its server hostname even though your email uses your own domain. The site address in a browser is also an unreliable shortcut for this field. A website can be hosted separately from email and have a perfectly valid certificate for the wrong service.
Check the computer's time if the app says an otherwise expected certificate is expired or has yet to become valid. If the clock and documented hostname are correct, report the error through a support channel you already trust. Leave validation in place while the provider checks. An unexpected certificate can indicate misconfiguration, and accepting it makes it harder to tell whether the app now reaches the intended server.
When the server rejects your login
Look for the provider's current authentication instructions for your account type. Some require a browser-based authorisation flow in supported email apps. Some issue app passwords under specific account policies. Others authenticate a defined mailbox username and password. A work administrator can restrict clients independently of the settings on a personal account with the same brand.
Check that the outgoing username is the one required for that specific mailbox. A common hosting configuration uses the full email address. A mail alias may receive messages through a different underlying mailbox, so the alias address may be accepted as a sender under provider rules while the primary mailbox is required for login. Verify the distinction in the provider's account settings.
Changing from 465 to 587 cannot give an account permission to sign in with an unsupported method. A working encrypted connection followed by an explicit authentication error is stronger evidence for checking authorisation than for another round of port changes. If the app uses a browser sign-in, complete the flow through the provider's expected page and allow it to return to the app normally.
When the app connects but sending still fails
Test with the primary mailbox address in From, one recipient you can check, a simple subject and a short text body. Record the outcome before changing anything. If that succeeds, compare it with the failing message. An alias, larger attachment, particular recipient or recipient domain can trigger a different server rule. A second successful test with a valid alias can establish which identities you're authorised to use.
A successful response to the outgoing app means the connected server accepted responsibility for that submission. The server still has to route the message to the destination. A later bounce, spam filtering or a missing Sent copy calls for a separate check. Find the actual recipient result or exact diagnostic before returning to port settings.
The most useful comparison is usually between two messages that differ in one thing. If one with a small body succeeds and one with an attachment fails to the same recipient, the server connection already worked for the plain message. If the exact same message works from your primary address and fails from a second address, check the sending identity. Repeatedly swapping ports makes both comparisons harder to interpret.
Copy the whole configuration into a desktop app
Open the mailbox provider's client settings while signed in to the account or use its current public instructions. Write down the outgoing hostname, port, security choice, authentication method and username. If the provider offers automatic setup, confirm which account is selected, particularly when you have personal and work accounts open in the same browser. You can keep a private record of the non-secret settings for future migrations.
cPanel shows manual connection settings through Set Up Mail Client for an individual email account. Its secure SMTP settings commonly display port 465 and require authentication. The hostname shown for the particular account matters because it should be the one that matches the provider's certificate. For a desktop walkthrough, follow the cPanel email guide.
Microsoft's Outlook.com instructions give a different example. They list smtp-mail.outlook.com, port 587, STARTTLS and OAuth2/Modern Auth for Outlook.com. The example illustrates why port and security are only part of the setup. If your address belongs to an organisation managed through Microsoft 365, use the organisation's own documented setup and supported client authentication.
For directly configured SMTP mailboxes, Swftink uses implicit TLS on port 465 and STARTTLS on other configured SMTP ports. Use the provider's published 465 or STARTTLS submission configuration where it is available. For a service that requires another combination, use a client or account connection method that supports the provider's requirements. The port controls SMTP sending independently of the IMAP connection used to retrieve mail.
When you verify a configuration, save the working version only after testing the From address and a real delivery to a mailbox you control. An account setup check may prove connectivity or sign-in without actually sending a message. Record which combination passed. That baseline makes it easier to investigate a later outage, password rotation, or provider migration without guessing what had worked.
Keep a working account while you test a change
Before changing an existing account, write down its current outgoing configuration and check which queued messages might be retried automatically. Make the change when you can watch the first attempted send. Where the provider offers both combinations, test the replacement with one fresh message and a distinctive subject. Check delivery in the destination mailbox and confirm the next regular message uses the account you intended. If the new settings fail, restore the previous working combination as a unit and report the exact failure for the replacement.
If a provider explicitly retires one port, its migration notice may also change the hostname or authentication policy. Treat that notice as a set of settings even if it headlines the port number. If your app can't represent the new settings, ask the provider which supported desktop connection methods are available. Keep your mail and pending drafts accessible while you make that change.
What to tell a provider when both published ports fail
Give the exact hostname, port, mode, account type, approximate time with time zone and error text. Include the app and operating system version if they're relevant to the case. State whether receiving works, whether webmail can send, and whether the same outgoing settings work from another approved network. A provider can often tell from the time and error stage whether its submission service received a connection attempt.
Describe each result separately. “465 with implicit TLS reports a certificate name mismatch and 587 with required STARTTLS times out on this network” is easier to investigate than “I tried both ports”. Mention any migration, service change or managed network involved. Support can then check the service it operates and tell you which route is intended for your account.
A troubleshooting note needs no password, recovery code, login token or complete message body. If an error contains real addresses or a private server name, share those only as required through your provider's private support channel. In a public question, substitute a reserved example address while keeping the port, encryption mode and exact non-sensitive error phrase. If the provider asks you to run another test, use a short new text message so that each attempt has a distinct timestamp.