Advertisement
What Is SMTP? A Complete Guide to SMTP Servers, Ports and Authentication
SMTP stands for Simple Mail Transfer Protocol. It is the standard protocol used for sending email messages between mail systems and for submitting messages to a mail server. When an application, website, or email client sends mail, it uses SMTP to get those messages toward the recipient's mailbox.

What Does SMTP Stand For?
SMTP stands for Simple Mail Transfer Protocol. Breaking down the name:
- Simple — the protocol defines a straightforward set of commands
- Mail — it deals with email messages
- Transfer — it moves messages between systems
- Protocol — it is a set of rules for communication
SMTP is primarily a sending and submission protocol. It is the protocol used to send and relay outgoing email, not to read it.
What Is an SMTP Server?
An SMTP server is a mail server responsible for accepting and relaying outgoing email according to its configuration and policies. It can:
- Authenticate senders
- Accept messages
- Relay messages
- Communicate with other mail servers
- Apply policies
- Return delivery errors
For example, when an email application sends a message, it connects to an SMTP server that accepts the message, authenticates the sender, and relays it toward the recipient's mail server.
How Does SMTP Work?
Sender ↓ Email Application / Website ↓ SMTP Submission Server ↓ SMTP Relay ↓ Recipient Mail Server ↓ Recipient Inbox
Each stage has a role:
- Sender — the person or system that initiates the message.
- Email application / website — the client that composes and submits the message.
- SMTP submission server — authenticates and accepts the outgoing message.
- SMTP relay — transports the message toward the destination.
- Recipient mail server — receives the message for delivery.
- Recipient inbox — where the message is made available to the recipient.

SMTP Example: Sending an Email
Consider a simple example. Alice sends from alice@example.com to bob@example.net:
Alice's application
↓
SMTP server
↓
example.net mail server
↓
Bob's mailboxTo route the message, SMTP uses DNS and MX records to discover the recipient's incoming mail server. The message then travels from Alice's sending infrastructure to Bob's mail server.
What Is SMTP Authentication?
Mail servers may require the sender to authenticate before they accept and relay a message. Authentication confirms that the user is authorized to send mail through that server.
- Username
- Password
- OAuth where supported
- Authentication mechanisms supported by the server
- TLS to protect the connection
Never store SMTP passwords insecurely or expose them to website visitors (see the security section below).
What Is SMTP TLS / SSL?
SMTP can be encrypted in transit. Two common terms appear in configuration interfaces:
STARTTLS
The connection can begin without encryption and then upgrade to TLS when the server supports it and it is required.
Implicit TLS
TLS is established as soon as the connection begins.
TLS is the modern encryption protocol, while "SSL" is still commonly shown in configuration interfaces even though modern systems should use secure encrypted connections.
SMTP Ports Explained
| Port | Typical use | Encryption |
|---|---|---|
| 25 | SMTP relay between mail servers | Depends on configuration |
| 587 | Message submission | Commonly STARTTLS |
| 465 | Submission over implicit TLS | TLS |
The IETF specifies message submission normally over port 587, while port 25 remains associated with SMTP relay. Not every provider supports every port, so always check the provider's configuration.

What Is SMTP Port 25?
Port 25 is the traditional SMTP relay port used for server-to-server email transport. It is different from message submission, and many networks restrict outbound port 25.
Applications should generally use a provider's submission service rather than attempting arbitrary SMTP relay directly. This is standard practice, not a workaround.
What Is SMTP Port 587?
Port 587 is used for message submission. It is common for email clients and applications, usually paired with STARTTLS and authentication.
The IETF (RFC 6409) specifies message submission normally over port 587. It is commonly recommended for submitting outbound mail because it supports authentication and policy controls appropriate for submission.
What Is SMTP Port 465?
Port 465 is used for SMTP submission over implicit TLS, where encryption begins when the connection starts. This differs from STARTTLS, which upgrades an unencrypted connection.
As an example, Google's current Gmail documentation supports SMTP submission on port 587 with TLS/STARTTLS and on port 465 with SSL. Port 465 is not universally supported, so check provider documentation.
Port 25 vs 465 vs 587
| Port 25 | Port 465 | Port 587 | |
|---|---|---|---|
| Main purpose | Relay | Secure submission | Message submission |
| Typical client use | Low | Yes | Yes |
| TLS | Provider/config dependent | Implicit TLS | STARTTLS |
| Authentication | Depends | Common | Common |
| Recommended for applications | Usually no | When provider supports it | Common choice |
Provider documentation should always take precedence over general guidance.
SMTP vs IMAP vs POP3
| Protocol | Main purpose |
|---|---|
| SMTP | Send email |
| IMAP | Read and synchronize email |
| POP3 | Download email |
In short: SMTP sends, IMAP provides access and synchronization, and POP3 downloads.

What Is SMTP Relay?
SMTP relay is the process of transferring a message through a mail server toward its destination. It is distinct from submission (a client sending mail to a server) and from final delivery (a server placing mail in a mailbox).
What Is SMTP Submission?
SMTP submission is when a client or application submits an outgoing message to a submission server. The distinction matters:
- SMTP relay: server-to-server transport.
- SMTP submission: a client/application submits an outbound message.
Per RFC 6409, this separation allows authentication and policy controls appropriate for message submission.
What Is an SMTP Response Code?
SMTP servers return response codes to indicate the status of a command or message transaction. The first digit groups the meaning:
| Code | General meaning |
|---|---|
| 2xx | Success |
| 3xx | Further action required |
| 4xx | Temporary failure |
| 5xx | Permanent failure |
Common examples include 220, 250, 421, 450, 451, 550, and 554. The exact meaning depends on the specific SMTP response.
Common SMTP Errors
- 421 — temporary service or connection problem.
- 450 — temporary mailbox or policy issue.
- 451 — temporary processing problem.
- 550 — permanent rejection.
- 554 — general transaction/message rejection.
For provider-specific examples, Google's SMTP error documentation includes cases of 421, 450, 451, 550, and 554 responses and explains that the response text provides additional context. Do not blindly retry permanent errors.
Advertisement
Why Is My SMTP Email Not Sending?
Diagnose the problem systematically by checking:
- SMTP hostname
- SMTP port
- Username
- Password / API credentials
- Authentication method
- TLS / SSL configuration
- Firewall / network restrictions
- Sender address
- DNS
- Provider sending restrictions
- SMTP response code
- Sender reputation

SMTP and DNS
DNS helps mail systems discover and authenticate sending and receiving infrastructure. This includes:
- MX records — point to the recipient's incoming mail servers
- SPF, DKIM, and DMARC — authenticate senders
- PTR / reverse DNS — helps verify sending IPs
To configure authentication correctly, see our guide to SPF, DKIM and DMARC, and to understand the wider picture read what email deliverability is.
SMTP and Email Deliverability
SMTP is the transport and submission mechanism, but SMTP itself does not guarantee inbox placement. Deliverability also depends on authentication, sender reputation, domain reputation, IP reputation, bounce rate, spam complaints, recipient engagement, content, and sending behavior.
To improve yours, follow our 15 best practices for email deliverability.
SMTP for Email Marketing
SMTP is used by email marketing platforms, SaaS applications, websites, CRMs, transactional email systems, and internal business applications. It is important to distinguish between:
- SMTP server: the technical sending infrastructure that transports email.
- Email marketing platform: the software used to manage contacts, campaigns, templates, and sending workflows.
SMTP vs Email Marketing Platform
| SMTP | Email Marketing Platform |
|---|---|
| Sends / transports email | Manages campaigns |
| Handles SMTP communication | Manages contacts |
| Authentication | Templates |
| Delivery responses | Segmentation |
| Server configuration | Campaign analytics |
| Technical infrastructure | Marketing workflow |
How MailCannon Uses SMTP
MailCannon provides a campaign-management layer that sits on top of SMTP. You can import and manage contacts from CSV, build HTML email templates, create and manage campaigns, and configure SMTP sending with your own SMTP host, port, username, password, and secure (TLS) setting. MailCannon also offers a way to connect Gmail sending via OAuth2.
In other words, SMTP provides the underlying email-sending mechanism, and MailCannon provides the tools to organize and run your email campaigns using it.
How to Choose an SMTP Server
Evaluate providers on:
- Reliability
- Authentication methods
- TLS support
- Sending limits
- Reputation
- Bounce handling
- Monitoring
- Provider policies
- Documentation
- Pricing
- Geographic availability
SMTP Configuration Example
# This is an EXAMPLE and not a real configuration. SMTP Host: smtp.example.com Port: 587 Security: STARTTLS Username: your-email@example.com Password: your-secure-credential Authentication: Required
Do not use smtp.example.com. You must obtain the correct values from your actual email provider.
SMTP Security Best Practices
- Use TLS
- Use strong credentials
- Never expose SMTP passwords in frontend JavaScript
- Store credentials securely
- Use environment variables / secrets
- Restrict access
- Rotate credentials when necessary
- Monitor suspicious activity
- Avoid open relay configuration
- Use appropriate authentication
Important: SMTP credentials should never be placed in client-side JavaScript or exposed to website visitors. Never commit SMTP credentials to Git, and never put them in public environment variables. For Next.js applications, SMTP credentials must remain server-side.
Frequently Asked Questions
What is SMTP?
SMTP stands for Simple Mail Transfer Protocol. It is the standard protocol used to send email between mail systems and to submit messages to a mail server.
What is an SMTP server?
A mail server responsible for accepting and relaying outgoing email according to its configuration and policies, including authenticating senders and returning delivery errors.
What does SMTP stand for?
Simple Mail Transfer Protocol — primarily a sending and submission protocol for email.
What is SMTP used for?
To send email: applications submit messages to an SMTP server, which relays them toward the recipient's mail server.
What is SMTP port 25?
Traditionally used for SMTP relay between mail servers. Many networks restrict it, and applications should generally use a submission service.
What is SMTP port 465?
SMTP submission over implicit TLS, where encryption begins at connection start. Support depends on the provider.
What is SMTP port 587?
Message submission, commonly with STARTTLS and authentication. The IETF specifies message submission normally over port 587.
What is the difference between SMTP and IMAP?
SMTP sends email; IMAP reads and synchronizes email stored on a server.
What is the difference between SMTP and POP3?
SMTP sends email; POP3 downloads email to a device.
Does SMTP improve email deliverability?
No. SMTP is the transport mechanism; deliverability also depends on authentication, reputation, list quality, engagement, and content.
What is SMTP authentication?
How a mail server identifies and authorizes the sender, typically with a username, password, OAuth, or another mechanism, often over TLS.
Why is my SMTP server not sending emails?
Likely an incorrect hostname or port, wrong credentials, misconfigured TLS or authentication, network restrictions, DNS issues, provider limits, or an SMTP response code.
Conclusion
SMTP is the foundation of email sending. It is the protocol applications use to submit and relay messages toward recipients. Understanding SMTP servers, ports, authentication, and TLS helps you configure sending correctly and troubleshoot problems. To go further, learn about SPF, DKIM and DMARC, how email blacklists affect delivery, and how to improve email deliverability.
Start Your Email Campaigns
Manage contacts, build campaigns, and send marketing email from one dashboard with MailCannon.
Advertisement