How To's
8 min read

How to Pick the Right SMTP Port: Understanding Ports 25, 587 & 465

Unlock the secrets of SMTP port selection with our expert guide. Dive into the differences between Ports 25, 587 & 465, and learn how to configure your mail server for optimal email delivery
Written by
Harsh P
Published on
February 7, 2024

Introduction to SMTP Port

Introduction to SMTP Port
Introduction to SMTP Port

What is Simple Mail Transfer Protocol (SMTP)

SMTP stands for Simple Mail Transfer Protocol. It is a protocol used in the Internet's email systems for sending emails between servers. SMTP is used to send messages from an email client to an email server or between servers for forwarding or relaying email messages

It defines a set of rules and commands that email servers use to communicate with each other to ensure emails are sent, received, and relayed among mail servers and clients.

SMTP is a part of the application layer of the TCP/IP protocol suite and is vital for the email delivery process.

What is an SMTP Port

Ports serve as gateways through which servers access a network and pull information, akin to an operator at a traditional switchboard routing incoming calls to the correct line. An SMTP port specifically orchestrates the flow of emails across a network to their intended recipients.

Common SMTP ports include:

  • Port 25
  • Port 587
  • Port 465

However, it's crucial to recognize that SMTP ports are not interchangeable. Selecting an inappropriate one can lead to undesirable outcomes, potentially tarnishing your reputation as an email sender.

Each SMTP port serves a distinct role in the process of email transmission, with specific ports used under different circumstances to enhance security and ensure compatibility with modern email infrastructure requirements.

How to Pick the Right SMTP Port

How to Pick the Right SMTP Port
How to Pick the Right SMTP Port

Selecting the appropriate SMTP port for your email communications is a crucial decision that impacts the security, reliability, and delivery of your emails.

Each SMTP port serves a distinct purpose, and understanding these can help you make an informed choice.

Here's an in-depth guide on how to pick the right SMTP port for your needs.

Understanding SMTP Ports

First, it’s important to grasp the role and function of the commonly used SMTP ports:

Port 25: Standard SMTP Port

This is the original port used for SMTP communications, primarily intended for email transmission between mail servers (server-to-server).

Due to its vulnerability to spam and misuse for sending unsolicited emails, many ISPs and hosting services now block or limit its use for outgoing email from personal devices.

Despite these challenges, Port 25 is still used for server-to-server communication in environments where security measures are strictly controlled, and both sending and receiving servers are trusted entities.

Port 587: Default SMTP Port

Port 587 is the default mail submission port. It is designated for email submission, specifically from an email client or application to a mail server.

This port is preferred for client-to-server email communication because it supports STARTTLS, an extension that upgrades a plain text connection to a secure, encrypted connection using TLS (Transport Layer Security). This ensures that emails sent via Port 587 can be protected against interception and eavesdropping.

Due to its enhanced security features and wide acceptance among email service providers, Port 587 is recommended for submitting outgoing emails, especially when the email is sent over public or unsecured networks.

Port 465: TLS SMTP Port

Port 465 was originally introduced for SMTPS, or SMTP over SSL, to provide a secure channel for email submission with SSL (Secure Sockets Layer) encryption from the connection's inception.

Although the use of Port 465 for SMTPS was deprecated in favor of STARTTLS on Port 587, many service providers and email clients continue to support it for secure SMTP communication.

Emails sent via Port 465 are encrypted, providing confidentiality and integrity for the email messages from the moment the connection is established.

Factors to Consider When Choosing an SMTP Port

When choosing an SMTP port, consider the following factors:

1. Email Sending Context

Are you configuring an email client, sending automated emails from an application, or setting up server-to-server email forwarding? For client-to-server email submission (e.g., from email clients like Outlook or applications), port 587 is generally recommended.

For server-to-server, port 25 is traditionally used, though its suitability may vary based on ISP and hosting policies.

2. Security Requirements

If securing email transmissions is a priority (as it should be), ports that support encryption are vital. Port 587 with STARTTLS is preferred for secure email submission, as it can upgrade a plain text connection to an encrypted one.

Port 465 is an alternative for SMTP over SSL from the start of the connection.

3. Service Provider Compatibility

Your email service provider’s recommendations and support for SMTP ports are crucial. Always check which ports are supported and recommended by your provider.

Adhering to their guidelines ensures better email delivery rates and compliance with their security protocols.

4. Network and ISP Restrictions

Be aware of any port restrictions imposed by your network administrator or ISP. Some networks block certain SMTP ports to prevent spam or due to security policies.

Understanding these restrictions can help you choose a port that ensures uninterrupted email delivery.

Choose the Appropriate SMTP Port Based on Your Requirements

Choose the Appropriate SMTP Port Based on Your Requirements
Choose the Appropriate SMTP Port Based on Your Requirements

When choosing the right SMTP port, weigh the importance of security, compatibility with your infrastructure, potential restrictions from your ISP or hosting provider, and the impact on email deliverability.

For Security Concerns

Email is often the vector for phishing attacks, malware distribution, and other security threats. If security is a primary concern, opt for ports that support SSL/TLS encryption

  • Port 587: This port is recommended for secure email submission because it supports STARTTLS, a protocol command that upgrades an existing insecure connection to a secure connection using SSL/TLS. This means that the email content is encrypted during transmission, protecting it from being intercepted or read by unauthorized parties.
  • Port 465: Although not officially recognized as a standard port for SMTPS (SMTP over SSL), it is widely used and supported by many email service providers for creating an encrypted connection from the start. This port is suitable for scenarios where you need to ensure that the connection is encrypted from the very beginning, without the STARTTLS upgrade process.

For Compatibility Issue

Ensure the port you choose is supported by both your email client and the server

  • Port 587 is widely supported by modern email servers and clients. It's the standard port for email submission and is designed to work seamlessly with authentication, which further enhances security.

When Facing ISP and Hosting Restrictions

Internet Service Providers (ISPs) and hosting services may impose restrictions on certain SMTP ports to combat spam and ensure the security of their networks.

  • Port 25 is often blocked by ISPs and cloud service providers because it's commonly used for spamming or sending unsolicited emails. This makes it a less desirable choice for legitimate email communication.
  • Ports 587 and 465 are less likely to be blocked since they require authentication and (in the case of Port 587) can be upgraded to a secure connection using STARTTLS. However, it's still important to check with your ISP or hosting provider to ensure these ports are open for use.

For Email Deliverability Issues

The choice of SMTP port can also affect your email deliverability. Emails sent from ports known for transmitting spam may be more likely to be flagged by spam filters.

  • Port 587 is recognized for legitimate email submission, making it less likely that emails sent through this port will be marked as spam.
  • Port 465, while secure, is less commonly used and might not be recognized by all email systems. However, if supported, it can still be a viable option for secure email submission.

Choosing an Alternative SMTP Ports

Alternative SMTP ports are essential for sending emails when your default port is blocked or unsuitable due to ISP restrictions or corporate firewall settings. Here's a concise overview of each alternative port and its use case:

Port 80: The HTTP Port

  • Use Case: Traditionally for HTTP traffic, it can be repurposed for SMTP to circumvent network restrictions. Requires server configuration to accept SMTP traffic, useful in strict network environments.

Port 443: The SSL Port

  • Use Case: Standard for HTTPS, encrypted web traffic. Like Port 80, it can be configured for SMTP, offering a secure path for email through networks that block traditional SMTP ports.

Port 588: The Secondary Email Port

  • Use Case: Not officially designated for SMTP and less commonly used. Its effectiveness depends on email service providers configuring their servers to accept SMTP traffic on this port.

Port 2525: The Alternate Port

  • Use Case: An unofficial standard for SMTP submission when standard ports are unavailable. It's widely accepted as an alternative due to its non-assignment to any specific service, making it versatile for bypassing network restrictions.

Key Takeaway: When standard SMTP ports like 25, 587, or 465 are inaccessible, alternative ports such as 80, 443, 588, and 2525 can be used for email transmission. The choice depends on network restrictions and server support. Always prioritize encrypted connections (SSL/TLS) for secure email communication, and consult your email service provider for specific configuration guidance.

How Your Emails are Correctly Sent, Received, and Delivered Across the Internet

SMTP servers and mail servers work together in a cohesive process to ensure that emails are correctly sent, received, and delivered across the Internet. This process involves several key steps, adhering to standards and protocols defined by organizations such as the Internet Engineering Task Force (IETF) and the Internet Assigned Numbers Authority (IANA)

SMTP Server and Mail Servers Work Together

Step 1: Email Creation and Submission

A user composes an email in their email client (e.g., Outlook, Gmail) and hits send. The email client connects to an SMTP server to submit the email for delivery. This server is typically operated by the user’s email service provider or their organization's own mail servers.

Step 2: SMTP Server Processing

The SMTP server receives the email and verifies that the user has the right to send emails through it. This step may involve authentication processes defined by the IETF to prevent unauthorized use of the SMTP service.

Step 3: DNS Lookup

The SMTP server queries a Domain Name System (DNS) server to find the Mail Exchange (MX) records for the recipient's domain. The MX record, maintained by the IANA, indicates the mail server responsible for receiving email on behalf of the domain.

Step 4: SMTP Relay

Once the SMTP server knows the recipient’s mail server, it connects to that server to transfer the email. This process is known as SMTP relay. If the recipient’s server is unreachable at first attempt, the SMTP server will queue the email and retry the connection periodically.

Step 5: Mail Server Reception

The recipient's mail server checks the incoming email for validity, scanning for spam or malware as per IETF standards. Upon passing these checks, the server accepts the email for delivery.

Step 6: Email Delivery to Mailbox

After acceptance, the mail server routes the email to the appropriate mailbox within the recipient's domain. If the recipient operates their own mail servers, the email is stored locally until the recipient accesses their mailbox.

Step 7: Email Retrieval

The recipient uses an email client, configured with either the Post Office Protocol (POP) or Internet Message Access Protocol (IMAP), to check for new emails. The client connects to the mail server, which delivers any new or pending messages to the recipient’s device.

Which SMTP Ports are Commonly Used in Your Email Server

Now, let's review the standard SMTP server settings and ports for Gmail and various SMTP services. In certain situations, you may have the option to adjust these ports to ones that better suit your needs. With established providers, the ports listed below have undergone thorough testing, ensuring their reliability.

If you're unsure, it's best to reach out to your service provider to determine which ports are available for use with their SMTP for email sending.

Service Name SMTP Server Port
Gmail 465 for SSL and 587 for TLS
Microsoft Outlook 587
Yahoo 465 for SSL and 587 for TLS
Mailtrap Email Sending 587 (recommended), 25, or 2525
Mailgun 587
Apple Mail 587
Amazon SES 587
Mandrill 587
SparkPost 587
SendGrid 587
Mailjet 2525
Postmark 587

Frequently Asked Questions

What is SMTPS

SMTPS stands for SMTP Secure, and it refers to the method of securing SMTP communications using SSL (Secure Sockets Layer) or TLS (Transport Layer Security) encryption. SMTPS is not a separate protocol but rather an approach to encrypt SMTP connections to enhance security.

The primary goal of SMTPS is to provide confidentiality and integrity for email messages in transit between the email client and the server or between email servers. It ensures that sensitive information contained in emails cannot be intercepted or tampered with by unauthorized parties.

What is the Role of SMTP in Email Delivery

When an email is sent, the email client (such as Microsoft Outlook, Apple Mail, or Gmail) uses SMTP to send the message to the recipient's mail server.

SMTP operates on a push model, where the sending server pushes the message to the receiving server. Once the email reaches the recipient's SMTP server, the protocol hands it over to the post office protocol (POP) or Internet message access protocol (IMAP) server, which then stores the message until the recipient retrieves it.

Which SMTP port should I use?

  • Port 587: Recommended for secure email submission, supports STARTTLS for encryption.
  • Port 465: Used for SMTPS, where email is sent over SSL/TLS from the beginning. Some providers still support this for secure connections.
  • Port 25: Mainly used for SMTP relay between servers. Due to its association with spam, it's often blocked for outgoing email by ISPs.

How do I troubleshoot SMTP port issues?

  1. Verify SMTP server settings.
  2. Check for correct port usage and ensure it aligns with your email provider's recommendations.
  3. Use network tools to test connectivity to the SMTP server.
  4. Investigate any ISP or firewall restrictions.
  5. Ensure proper configuration of encryption and authentication settings.
  6. Consider using alternative SMTP ports if standard ports are blocked or not working.

What is Alore?

Email Warmer

Generate real engagement to Warm Up Your Email Address without any human intervention

Drip Campaigner

Send emails that generate new business opprotunities for you

Collaborative Inbox

Improve team performance & customer experience - manage multiple email addresses from one place