Choosing the right SMTP port can make a big difference when you are setting up email for a website, application, WordPress site, or business system. SMTP ports control how your application connects to a mail server, and using the wrong one can lead to connection failures, authentication errors, or blocked messages.
The four ports you will see most often are 25, 465, 587, and 2525. They do not all serve the same purpose, however. Port 25 is mainly used for mail server-to-server communication, while port 587 is generally the best choice for applications and email clients.
Port 465 is useful when a service requires implicit TLS, while port 2525 can be a practical alternative when your network or hosting provider blocks 587. Understanding these differences will make SMTP configuration much easier.
What Is SMTP?
SMTP stands for Simple Mail Transfer Protocol. It is the standard protocol used to send email messages between applications, email clients, and mail servers.
For example, when a website sends a password-reset email, order confirmation, contact-form notification, or account verification message, it needs a system capable of delivering that email. SMTP provides the communication rules that allow the application to submit the message to an outgoing mail server.
SMTP is mainly concerned with sending email. Protocols such as IMAP and POP3 are generally used when an email client needs to retrieve messages from a mailbox.
For businesses and developers, SMTP remains an important part of reliable transactional email delivery.
What Are SMTP Ports?
An SMTP port is a network endpoint used when establishing an SMTP connection. Different ports have different purposes and encryption methods, so selecting the correct one is important.
The four common SMTP ports are:
- Port 25: Mainly used for server-to-server SMTP relay.
- Port 465: SMTP submission using implicit TLS.
- Port 587: The standard choice for authenticated SMTP submission.
- Port 2525: An alternative submission port when another port is unavailable.
For most websites, applications, and email clients, port 587 with STARTTLS is the best starting point.
SMTP Port 25 vs 465 vs 587 vs 2525
Although all four ports can be associated with SMTP, they are designed for different situations. Using a port simply because it is labeled “SMTP” can cause problems if your application expects a different encryption method or authentication process.
| SMTP Port | Main Purpose | Encryption | Best Use |
|---|---|---|---|
| 25 | Server-to-server relay | Opportunistic STARTTLS | Mail servers |
| 465 | SMTP submission | Implicit TLS | Apps requiring SSL/TLS from the start |
| 587 | SMTP submission | STARTTLS | Most apps and email clients |
| 2525 | Alternative submission | STARTTLS | When 587 is blocked |
The easiest rule is simple: use 587 for normal SMTP submission, 2525 as a fallback, 465 when implicit TLS is required, and 25 mainly for mail-server relay.
What Is SMTP Port 25 Used For?
Port 25 is the traditional SMTP port and has been used for email delivery for decades. Its primary role today is communication between mail servers.
For example, when your outgoing mail server needs to deliver a message to another mail server, port 25 may be involved in the relay process. This is different from an application submitting a message to its email provider.
Port 25 is generally not recommended for websites, WordPress installations, desktop email clients, or application-based SMTP submission. Many internet service providers and cloud hosting companies restrict outbound connections to this port because it has historically been abused for spam.
If your application cannot connect through port 25, changing to 587 is usually a better solution than trying to force port 25 to work.
What Is SMTP Port 465 Used For?
Port 465 is commonly associated with implicit TLS. With this setup, encryption begins immediately when the connection is established.
This is different from STARTTLS, where the connection initially establishes an SMTP session and then upgrades the connection to TLS.
Port 465 was once considered deprecated, which is why you may still find older guides telling you to avoid it. However, RFC 8314 brought port 465 back for SMTP submission using implicit TLS.
Today, many email providers support port 465. It can be a good choice when your provider specifically instructs you to use SSL/TLS from the beginning.
The important point is to match the port with the correct encryption setting. Using port 465 with STARTTLS settings, for example, can result in a failed connection.
What Is SMTP Port 587 Used For?
Port 587 is generally the default SMTP submission port for modern applications and email clients.
It is designed for clients and applications that need to submit outgoing messages to an email server. Authentication is normally required, which helps prevent unauthorized users from turning the server into an open relay.
Port 587 commonly uses STARTTLS to encrypt the connection. Once TLS negotiation succeeds, the authentication details and email content can be transmitted securely.
If you are configuring SMTP for a WordPress website, contact form, SaaS application, CRM, or custom software, port 587 should normally be your first choice.
What Is SMTP Port 2525 Used For?
Port 2525 is commonly offered as an alternative SMTP submission port. It is particularly useful when a network, firewall, ISP, or hosting provider blocks the standard SMTP submission port.
Unlike ports 25 and 587, port 2525 is not an official standard SMTP port assigned specifically for this purpose. However, many email service providers support it because it can provide another route for SMTP submission.
Port 2525 commonly supports STARTTLS, making it a useful fallback when port 587 cannot be reached.
For example, if your application works perfectly with the correct username, password, server, and encryption settings but cannot connect to port 587, your provider may allow you to switch to 2525.
STARTTLS vs Implicit TLS
One of the most confusing parts of SMTP configuration is the difference between STARTTLS and implicit TLS.
With STARTTLS, the SMTP connection begins normally and then requests an upgrade to an encrypted TLS session. Once the upgrade succeeds, authentication and email transmission can continue securely.
With implicit TLS, encryption starts immediately when the connection opens. Port 465 is the common SMTP submission port associated with this method.
For most applications, the practical configuration looks like this:
- Port 587 → STARTTLS/TLS
- Port 465 → SSL/TLS
- Port 2525 → Usually STARTTLS/TLS
- Port 25 → Primarily SMTP relay
Do not simply select “SSL” or “TLS” without checking the port requirements from your email provider. The encryption mode and port need to match.
Why SMTP Authentication Matters
Encryption and authentication solve two different problems.
TLS protects information while it travels between your application and the SMTP server. Authentication tells the server that your application is authorized to send email through the account.
Without authentication controls, an SMTP server could potentially become an open relay. Open relays are attractive targets for spammers and can quickly damage the reputation of the server’s IP address.
Modern SMTP providers therefore require credentials or another approved authentication mechanism before accepting messages for submission.
For application-based email, always use the credentials supplied by your email provider. Never place passwords directly into publicly accessible source code or configuration files that are committed to a public repository.
How to Configure SMTP With Unione
When using Unione for application email, the exact names of settings can vary depending on your software, but the basic SMTP configuration follows the same principles.
A typical setup can look like this:
- SMTP host:
smtp.us1.unione.io - Port:
587 - Encryption: STARTTLS/TLS
- Authentication: Enabled
- Username: Your SMTP account username or user ID
- Password: Your SMTP password or supported API credential
The most important part is to follow the current configuration information provided by your SMTP service.
If your application offers options such as “SSL,” “TLS,” “STARTTLS,” or “None,” do not choose randomly. Select the option that matches the port and provider documentation.
For developer-specific configuration, consult the SMTP API documentation for the latest integration details
Common SMTP Problems and Solutions
SMTP errors usually fall into a few common categories. Identifying the category first is much faster than randomly changing settings.
Port Is Blocked
If the connection times out, your network may be blocking the selected port.
Try port 587 first. If it is blocked, check whether your provider supports port 2525. Avoid switching to port 25 unless you are actually managing a mail server and understand the relay requirements.
Authentication Failed
A 535 authentication error usually means the server rejected your credentials.
Check the username, password, API credential, and authentication method. Also look for accidental spaces or line breaks when copying credentials.
TLS Configuration Is Wrong
If you receive SSL or TLS errors, check that the encryption mode matches the port.
For example, port 587 normally uses STARTTLS, while port 465 normally uses implicit TLS.
Messages Are Rejected
If the SMTP connection works and authentication succeeds but messages are still rejected, the issue may no longer be the SMTP port.
Check your domain’s SPF, DKIM, and DMARC records, sending reputation, message content, recipient policies, and account limits.
Changing from 587 to 2525 will not fix a DNS or sender-reputation problem.
Which SMTP Port Should You Choose?
For most users, the answer is straightforward.
Choose port 587 when your application, website, or email client needs to submit outgoing email. It is the modern standard for authenticated SMTP submission and normally works with STARTTLS.
Use port 2525 when port 587 is unavailable and your email provider supports the alternative port.
Choose port 465 when your provider or application specifically requires implicit TLS.
Use port 25 primarily for server-to-server SMTP relay rather than normal application submission.
This simple approach covers the vast majority of SMTP configuration scenarios.
Practical SMTP Setup Tips
Before troubleshooting SMTP, double-check the basic settings. A small configuration mistake can look like a much larger server problem.
Use these checks:
- Confirm the SMTP hostname.
- Start with port 587.
- Enable STARTTLS/TLS.
- Turn on SMTP authentication.
- Use the correct SMTP credentials.
- Check whether your hosting provider blocks outbound SMTP connections.
- Test the port independently if the application cannot connect.
- Verify SPF, DKIM, and DMARC after successful SMTP authentication.
- Never disable TLS certificate verification in production.
- Keep SMTP passwords and API credentials out of public source code.
It is also a good idea to test email delivery with a small number of controlled messages before sending a large campaign or enabling automated notifications.
Final Thoughts
SMTP ports can look confusing because ports 25, 465, 587, and 2525 are all associated with email sending but serve different purposes. The key is to understand the difference between SMTP relay and SMTP submission, then select the appropriate encryption method.
For most websites, applications, and email clients, port 587 with STARTTLS and authentication is the best default. If your network blocks 587, port 2525 is a useful alternative. Port 465 remains relevant when implicit TLS is required, while port 25 is mainly intended for mail-server relay.
Once the port, encryption, authentication, and server hostname are correctly configured, SMTP setup becomes much more predictable. If delivery problems continue after the connection works, investigate DNS authentication, sender reputation, account limits, and recipient-server policies rather than changing ports repeatedly.
Frequently Asked Questions
Is SMTP port 587 secure?
Yes. Port 587 can provide a secure connection when STARTTLS is enabled and the client is configured to require TLS. Authentication should also be enabled before submitting email.
Should I use port 25 or 587?
For an application or email client, use 587 in most cases. Port 25 is primarily intended for mail-server-to-mail-server relay and is commonly blocked for outbound connections.
Is port 465 still valid?
Yes. Port 465 is used for SMTP submission with implicit TLS. It is a suitable option when your email provider or application specifically supports or requires this connection method.
What should I use if port 587 is blocked?
Try port 2525 if your SMTP provider supports it. It is commonly used as an alternative submission port and can support TLS.
Does changing the SMTP port improve email deliverability?
Not usually. The correct port helps your application establish a reliable SMTP connection, but overall email deliverability also depends on factors such as SPF, DKIM, DMARC, sender reputation, message quality, bounce rates, and recipient-server policies.
What is the best SMTP port for WordPress?
For most WordPress websites, port 587 with STARTTLS is the recommended starting point. If your hosting environment blocks it, check whether your SMTP provider offers port 2525 as an alternative.