November 20, 2026
Written by
- SMTP is the protocol, and the SMTP server runs it: The protocol is the set of rules. The server is the software that sends and relays mail by those rules.
- SMTP handles sending only: POP3 and IMAP retrieve mail from an inbox. SMTP moves it from server to server.
- Port 587 is the default for sending: It's the standard submission port with STARTTLS encryption. Port 465 also works, and port 25 is mostly for server-to-server relay and often blocked by ISPs and cloud hosts.
- Most businesses don't run their own SMTP server: An SMTP service like Twilio SendGrid manages the infrastructure, authentication, and deliverability, so you only need a hostname, a port, and an API key.
An SMTP server is a mail server that sends and relays outgoing email using SMTP (Simple Mail Transfer Protocol), the internet standard for moving email between servers. When you hit Send, your email client hands the message to an SMTP server, which finds the recipient's mail server and passes the message along until it lands in the right mailbox.
Every email you've ever sent (password reset, newsletter, "running late" note to your boss) went through at least one SMTP server. Think of it as the internet's postal service. It takes your message, figures out where it's going, and hands it to the next stop until it arrives, usually in under a second.
Here's how SMTP servers work, which server address and port to use, and when it makes sense to let an email service run SMTP for you.
What is SMTP (and what does SMTP stand for)?
SMTP stands for Simple Mail Transfer Protocol. It's the internet standard (defined in RFC 5321) that email clients and mail servers use to send and relay outgoing email.
SMTP handles the sending side of email. It's the shared language one mail server uses to hand a message to another. Without it, Gmail couldn't deliver to Outlook, and your app couldn't send a receipt to anyone.
- S = Simple: SMTP is designed to be straightforward and easy to implement.
- M = Mail: SMTP is built to send email messages across networks.
- T = Transfer: SMTP is responsible for transferring email messages from one server to another.
- P = Protocol: SMTP is a set of rules (or protocols) that lets different email systems and servers communicate with each other.
What SMTP does (and doesn’t) do
As the “T” in its name indicates, SMTP is a transport protocol: All it does is move messages from point A to point B.
Like many other Internet protocols, SMTP is intended to be used on top of the Transmission Control Protocol (TCP), which guarantees reliable delivery of the individual packets that make up a conversation.
Because SMTP runs on TCP, you can count on the message contents reaching the next server intact. What happens after that is up to the receiving server.
Imagine what happens when a delivery driver leaves a package at your office on a Saturday. What happens to it after delivery isn’t his problem.
SMTP doesn't handle deliverability, tracking, or analytics on its own, and the original spec had no authentication or encryption. Extensions like SMTP AUTH and STARTTLS added those later, and email service providers cover the rest.
What is an email server—and what is an SMTP server?
"Email server" (or mail server) is the umbrella term for any system that sends, receives, or stores email. An SMTP server is the outgoing piece. It accepts mail from your email client or app and relays it toward the recipient's mail server. Every message you send passes through at least one.
Because an SMTP email server pertains to outgoing email, it’ll have an address (or addresses) that the mail client or application you use can set that generally looks like this: smtp.serveraddress.com. For example, the SMTP server Gmail uses is smtp.gmail.com, and and Twilio SendGrid's is smtp.sendgrid.net. You can generally find your SMTP email server address in the account or settings section of your mail client.
Using a store and forward process, SMTP works with the mail transfer agent to move your email across networks to the right computer and email inbox.
So when you send from Gmail, Gmail's SMTP server processes your message, looks up which server handles the recipient's domain, and relays it there. The recipient's mail server accepts it and stores it in their mailbox, and their email app picks it up using IMAP or POP3.
For the technical details of sending through Twilio SendGrid, see our SMTP integration docs.
What is an SMTP email service?
SMTP email services run the SMTP infrastructure for you. They're email service providers (like Twilio SendGrid) that handle the behind-the-scenes work of formatting, sending, and delivering your email to the recipient's mail server.
An SMTP email service manages the complex infrastructure for you. It does everything from:
- Improving email deliverability
- Securing sent emails
- Providing valuable email performance analytics
SMTP server addresses and ports for popular email providers
Your SMTP server address is usually "smtp." followed by your provider's domain. To find yours, check the account or server settings in your email app, or search your provider's help center for "SMTP settings." Most providers use your full email address as the username, and many require an app password when two-step verification is on.
Is an SMTP server the same as a normal server?
Like most servers, the SMTP server processes data sent to another server, but it has the specific purpose of processing data related to the sending and relaying of email. An SMTP server doesn't need a dedicated machine, either. It's software, often called a mail transfer agent (MTA), that can run alongside other services and listens for new mail to send.
Why are SMTP servers important?
When communicating over email, it's crucial to send email to your recipient safely and on time. However, without an SMTP server, your email can’t make it to its destination.
Once you hit Send, your email client packages the message (headers, body, and attachments) and hands it to the SMTP server, which handles every step from there to the recipient's server.
Your SMTP server also checks that you're allowed to send. It requires you to sign in (called SMTP authentication, or SMTP AUTH) before it'll relay anything, which keeps spammers from using it as an open relay.
If the email is undeliverable, the SMTP ensures the email will bounce back to the sender, letting them know they have an incorrect email address or the receiving email server blocked the email for whatever reason. Each bounce carries an SMTP response code that tells you what went wrong.
Want more information on SMTP? Check out our SMTP Service Crash Course.
How SMTP servers work
Here's what happens when you hit "Send" on an email:
1: Initial connection: Your email client (like Outlook or Gmail) connects to your outgoing SMTP server using a specific port (typically 587 or 465)
2: Authentication handshake: The SMTP server verifies your credentials through a process called SMTP AUTH. Your email client provides your username and password, and the server confirms you're authorized to send emails through that account.
3: Message composition verification: Your SMTP server examines the email details:
- Sender address: Confirms the "From" field matches your authenticated account
- Recipient addresses: Validates the format of destination email addresses
- Message content: Checks the email body and any attachments for size limits and formatting
4: Recipient server lookup: Your SMTP server performs a DNS lookup to find the recipient's mail server. It searches for MX (Mail Exchange) records associated with the recipient's domain.
5: Server-to-server communication: Your SMTP server initiates a conversation with the recipient's mail server using a series of standardized commands:
- HELO/EHLO: Your server introduces itself
- MAIL FROM: Specifies who's sending the email
- RCPT TO: Identifies the intended recipient
- DATA: Transfers the actual email content
6: Recipient server processing: The recipient's mail server runs its own checks:
- Spam filtering and security scans
- Authentication verification (SPF, DKIM, DMARC)
- Mailbox availability and storage limits
- Organizational policies and rules
7: Final delivery: If everything checks out, the recipient's server accepts the message and places it in the recipient's mailbox. The receiving server then sends a delivery confirmation back to your SMTP server.
What does the SMTP server do when I send an email with Twilio SendGrid?
- Your app or mail client connects to the Twilio SendGrid SMTP server, smtp.sendgrid.net, ideally on port 587 with TLS. (Ports 25, 2525, and 465 also work.)
- Your mail client has a conversation with our server, first verifying your credentials (the username is literally "apikey," and the password is your SendGrid API key), then relaying the message information, such as sender address, recipient, and message content.
- Our server takes the message information we gathered from your request, then repeats the conversation process in step 2 with the recipient’s mail server.
- Your recipient's mail server checks the sending address, the recipient address (to confirm it's a valid mailbox), and the message content. It also checks your sending domain's DNS records, including your SPF, DKIM, and DMARC results. If everything passes, it accepts the message and stores it in the recipient's mailbox, and the recipient's email app pulls it into their inbox using IMAP or POP3.
Does Twilio SendGrid have a test SMTP server?
SendGrid offers free accounts that you can enable without a credit card. With a free SendGrid account, we give you access to the SendGrid SMTP server and allow you to send up to 100 emails per day—effectively giving you an SMTP server for testing.
Active free account customers can also use their account to send test messages and test their email deliverability before upgrading and sending significantly more email.
Do I need to set up the Twilio SendGrid SMTP server before sending an email?
There's nothing to install. Create an API key in your Twilio SendGrid account, then add these settings to your app or email client:
- Server: smtp.sendgrid.net
- Port: 587 (STARTTLS) or 465 (implicit TLS)
- Username: apikey
- Password: Your API key
What SMTP server port do I need to connect to?
Use port 587 for most setups. It supports STARTTLS, which upgrades the connection to an encrypted one. Ports 25 and 2525 work the same way, and 2525 is a handy fallback when your network blocks 25 and 587. For implicit TLS (sometimes called SSL), where the connection is encrypted from the first byte, use port 465. For a deeper comparison, see ports 465 vs. 587.
Short history of SMTP
SMTP was built to be a lightweight, easy-to-implement means to transfer plain-text messages between devices. The original SMTP standard distinguished between a mail transport agent (MTA)—what modern administrators would call a server—and mail user agents (MUA), which most people refer to as clients.
SMTP’s goal was to provide a way for two MTAs to pass message traffic back and forth. The protocol doesn’t define any standards for storing messages, giving clients access to them, or carrying complex content types such as audio or image data. It’s just a set of rules for moving a properly structured message from point A to point B.
ARPANET
The original Internet grew from ARPANET, a closed research network that was designed for academic and government use.
ARPANET and the early implementation of the Internet were designed around the assumption that only a limited number of trusted users would be able to connect to the network.
The competing X.400 protocol was intended to be a more robust message transfer protocol that would be suitable for commercial use; X.400 included features for guaranteed reliable delivery, message tracking, and other security and authentication features. However, it was complex to implement, and it ultimately lost out to the simpler, less complex, less expensive SMTP implementations.
The version of SMTP that we use today still shows a number of design influences that trace back to its origins:
- The protocol itself didn’t provide for authentication or encryption, which weren’t especially important on a trusted network with trustworthy users. (Since SMTP’s appearance, a series of extensions to the standard have added these features.)
- The ability to get return receipts or delivery notifications is dependent on which client recipients use; servers are required to send delivery status notifications (DSNs) only for messages that are permanently undeliverable.
- There’s no enforced mechanism for classes of service; for example, FedEx and UPS both let you choose from multiple delivery speeds according to how much you’re willing to pay.
- Email filtering often seems capricious, and users have learned through experience that important messages may be filtered arbitrarily by the spam filters in their client, in their server, or somewhere in the cloud. (And now of course, recipients can filter messages within their own inboxes through features like Gmail’s “tabs”.)
- SMTP has no built-in way to track opens or clicks, so email relies on web technology (tracking pixels and redirected links) to measure them.
The evolution of email
As the Internet spread, businesses were allowed to connect to it. However, they were informally banned from using it for commercial purposes.
A few large companies (notably IBM, DEC, and Control Data) built corporate email systems for large-company use, and as time passed, smaller companies—including Novell, Lotus (now IBM Lotus), and Microsoft—saw the business value in email systems and began building and delivering intra-company systems that broadened the email market.
None of these systems provided much in the way of interoperability, although after the SMTP standard was defined a few forward-looking vendors began adding SMTP support through gateways or connectors that linked MTAs from different vendors.
The difficulty of getting interoperability to reliably work across multiple MTA vendors and their individual connectors put a lot of market pressure on vendors to come up with a simpler, more robust solution, so native SMTP began to gather real momentum in the mid-1990s.
Now, it is the de facto standard for transferring mail between servers. Even products that once used proprietary protocols rely on SMTP both for message transport.
SMTP's evolving role in modern email infrastructure
While SMTP remains the backbone of email delivery, it now works in concert with several newer technologies to improve email security, deliverability, and user experience. Let's explore how SMTP interacts with some of these modern email innovations:
SMTP and DMARC (Domain-based Message Authentication, Reporting, and Conformance)
DMARC builds upon SMTP by adding an extra layer of sender authentication:
- SMTP handles the actual email transmission, while DMARC verifies that the sender is authorized to use the sending domain.
- When an email is sent via SMTP, the receiving server checks the DMARC record in the sender's DNS.
- DMARC uses SPF (Sender Policy Framework) and DKIM (DomainKeys Identified Mail)—both of which work alongside SMTP—to authenticate the sender.
- If authentication fails, DMARC policies instruct the receiving server on how to handle the message, potentially rejecting it before it enters the recipient's inbox.
- Since 2024, Gmail and Yahoo have required DMARC for senders who send more than 5,000 messages a day to their users, and Microsoft added the same rule for Outlook.com in 2025.
SMTP and BIMI (Brand Indicators for Message Identification)
BIMI improves the visual aspect of emails delivered via SMTP:
- After an email is successfully delivered through SMTP and passes DMARC authentication, BIMI comes into play.
- BIMI allows organizations to display their logo next to authenticated emails in the recipient's inbox.
- This visual indicator helps recipients quickly identify legitimate emails, adding a layer of trust to SMTP-delivered messages.
SMTP and TLS encryption
SMTP sends everything in plain text by default. Encryption gets layered on top:
- STARTTLS: Upgrades a plain SMTP connection to an encrypted one on ports 587, 25, and 2525 (how STARTTLS works).
- Implicit TLS: Encrypts the connection from the first byte on port 465.
- MTA-STS: Lets a receiving domain tell sending servers to always use TLS and refuse to deliver over an unencrypted connection, which blocks downgrade attacks.
Send an SMTP email with Twilio SendGrid
Now that you're an SMTP expert (basically, right?), it's time to put your knowledge into action. Whether you're a seasoned email marketer or just starting out, Twilio SendGrid has the tools and support you need to make and deliver your email campaigns.
Why choose SendGrid for your SMTP sending?
- Reliability: Our robust infrastructure handles billions of emails monthly, guaranteeing your messages get delivered.
- Scalability: From 100 emails to 100 million, we grow with your business.
- Expert support: Our team of email experts is always ready to help you optimize your sending.
- Advanced analytics: Gain deep insights into your email performance to continually improve your strategies.
Check out our documentation to learn how to send an SMTP email. Then, once you sign up for a free account, we’ll walk you through the process and share resources to help you get started.
FAQs about SMTP
How does SMTP differ from POP3 and IMAP?
While SMTP handles sending emails, POP3 (Post Office Protocol) and IMAP (Internet Message Access Protocol) are responsible for receiving emails. SMTP pushes emails out, while POP3 and IMAP pull emails into your inbox. POP3 typically downloads emails to a single device, removing them from the server, while IMAP syncs emails across multiple devices by leaving them on the server.
Can I use SMTP without an email service provider?
Technically, yes—you can set up your own SMTP server. However, this isn't recommended for most users or businesses. Running your own SMTP server requires technical expertise, constant maintenance, and can lead to deliverability issues. It's generally more efficient and reliable to use an established email service provider that handles SMTP for you.
What's the difference between SMTP and SMTP relay?
SMTP is the basic protocol for sending emails, while SMTP relay is a service that routes emails through a trusted third-party server. SMTP relay is particularly useful for businesses sending large volumes of emails, as it can improve deliverability and provide additional features like analytics and security measures.
How does SMTP authentication work?
SMTP authentication (often called SMTP AUTH) is a security measure that requires users to log in with a username and password before sending emails. This helps prevent unauthorized use of mail servers and reduces spam. Common authentication methods include LOGIN, PLAIN, and CRAM-MD5.
What are some common SMTP errors?
Some frequent SMTP errors include:
- 550 error: Indicates the recipient's mailbox is unavailable or the server is refusing to relay your message
- 554 error: Often means your message was rejected as spam
- 421 error: Suggests the receiving mail server is temporarily unavailable
Understanding these errors can help troubleshoot email delivery issues.
How does SMTP relate to email spoofing and phishing?
SMTP's original design didn't include strong sender authentication, which made it vulnerable to email spoofing—where attackers fake the 'From' address. This weakness is often exploited in phishing attacks. Modern authentication protocols like SPF, DKIM, and DMARC work alongside SMTP to verify sender identities and reduce these threats.
Can SMTP handle attachments and rich media?
Originally, SMTP was designed for plain text messages only. However, extensions like MIME (Multipurpose Internet Mail Extensions) allow SMTP to handle attachments, HTML formatting, and other rich media. These extensions essentially encode non-text content so it can be transmitted via SMTP.











