We send emails to one another all the time—a whopping 306.4 billion emails are sent and received every day. It’s one of the most common communication methods for businesses and individuals alike, but have you ever stopped and wondered what goes on after you click “send”? How does your message go from you to your recipients?
There’s a complex process going on behind the scenes to get your emails where they need to be. At the center of it all is an email protocol known as SMTP that’s critical for sending emails… and you’re about to learn everything you need to know about it.
What is SMTP? #
SMTP, which stands for Simple Mail Transfer Protocol, is an email protocol used for sending email messages from one email account to another via the internet.
Email protocols are sets of rules that let different email clients and accounts easily exchange information, and SMTP is one of the most common ones alongside POP and IMAP. It is also the only dedicated protocol for sending emails. Most email clients—including Outlook, Apple Mail, Gmail, and Yahoo Mail—rely on SMTP to “push” or send messages from a sender to a recipient.
What is an SMTP server? #
Like all servers, an SMTP server is an application that provides a service to other applications within a network, called clients. Specifically, an SMTP server handles the sending, receiving, and relaying of email.
You can think of servers as your real-life post offices. When you send a letter from city A to city B, it first reaches a local post office in city A; here, it gets processed and sent on the post office in city B, which is in charge of delivering it to its final destination.
The same happens with SMTP servers—though instead of taking days, the process takes a few minutes at most.
You might have also come across the term SMTP port.Those are the communicationendpoints that handle the transfer of email data over SMTP as it moves through a network, from one server to another. We cover those in detail here.
How does SMTP work? #
The best way to explain how SMTP works is to go over the sending process, the individual rules and commands that power it, and the errors you may encounter. Fair warning: This is where things start to get technical. Still, we’ll do our best to condense this protocol down into easy-to-digest chunks.
Once an SMTP server is established, email clients can connect to and communicate with it. When the user hits “send” on an email message, the email client opens an SMTP connection to the server so it can send. (The SMTP connection is built on something called a TCP connection, which stands for Transmission Control Protocol.)
From there, the SMTP client uses commands to tell the server what to do and transfer data, like the sender’s email address, the recipient’s email address, and the email’s content. The Mail Transfer Agent or Message Transfer Agent (MTA) checks to see if both email addresses are from the same email domain, such as gmail.com:
- If they are, it sends the email right away
- If not, the server uses the Domain Name System (DNS) to identify the recipient’s domain and then send it to the right server.
You don’t need to get into the weeds of SMTP to start sending emails. Postmark’s SMTP email service can handle it all for you and getting started is as simple as copying some credentials into a config file.
Learn more →
Basic SMTP commands #
As we mentioned earlier, SMTP commands are a set of codes that power the transmission of email messages between servers. Here are the basic SMTP commands you should be aware of:
- HELO or EHLO (Hello): This is a crucial command for beginning the entire email sending process. The email client is identifying itself to the SMTP server. It is the beginning of a conversation and usually involves the server sending a HELO command back complete with its domain name/IP address.
- MAIL FROM: Following the identification command, the sender will share code that specifies who the mail is from. This outlines the email address and tells the SMTP server that a new transaction is about to start. From here, the server resets everything and is ready to accept the email address. Once accepted, it will reply with a 250 OK reply code.
- RCPT TO (Recipient To): The next command follows the 250 OK reply code identifying who the email is being sent to. Again, the SMTP server responds with the same code, at which point another RCPT TO command can be sent with a different recipient’s email address. This can go back and forth as many times as required depending on how many people will receive the email.
- DATA: This triggers the transfer of data between the client and the server. All of the message contents will be moved to the SMTP server, which will respond with a 345 reply code. The contents of the messages are transferred to the server, where a single dot is sent in a line by itself to signal the end of the message. If accepted and ready for delivery, the server sends another 250 OK code. At this point, the message is on its way to the recipients.
- QUIT: When the email has been sent, the client sends the QUIT command to the server, severing the connection. If it has been successfully closed, the server will reply with a 221 code.
- RSET (Reset): This command is sent to the server when the mail transaction needs to be aborted. It doesn’t close the connection, but it does reset everything and remove all previous data about the email and the parties involved. You will commonly use this when there has been an error, like inputting the wrong recipient information, and the process needs to be restarted.
Picture these commands as the language that allows email servers to have a conversation with each other. Their chat will look somewhat like this:
There are other SMTP commands that handle authentication and enhance security, such as AUTH and STARTTLS. If you’re interested in learning about them or seeing examples of SMTP at work, read this guide to SMTP commands.
Understanding SMTP error codes #
The email sending process doesn’t always go as smoothly as in the example chatter of our email servers above. Bounces, blocks, or other issues might prevent an email from being sent. In this case, the receiving server can notify you of issues using SMTP error codes, and knowing what they mean helps you diagnose and fix email delivery roadblocks.
For example, here are two groups of SMTP errors that crop up often:
- 4.X.X Persistent Transient Failure: These error codes start with the number “4” followed by two other numbers. They typically mean that there’s a temporary failure with the mail server. Repeating the command again could get rid of the error, but these codes are often used by servers to keep untrusted senders at bay.
- 5.X.X Permanent Error: These error codes begin with the number “5” and are followed by two numbers. They typically signify that the SMTP connection has dropped. If you try to resend the email, it will likely still result in the same error.
PS: if you’re interested in learning more about SMTP errors, here at Postmark we started a public SMTP Field Manual to document the error codes we see most often. Check it out! You can even contribute your own entries if you’ve spotted an SMTP error we haven’t encountered before.
How is SMTP different from other email protocols? #
Cast your mind back to the definition of SMTP, and you’ll remember we said that it was one of many email protocols. POP and IMAP are the other two most common email protocols in use.
The main difference between these protocols is that SMTP is the only protocol for sending or “pushing” email from one unknown mail server to another. POP and IMAP are protocols for receiving or “pulling” mail for the recipient from their own mail server. So, POP and IMAP limit the transfer of mail to verified mail servers only. They can’t be used for communication outside of your own networks.
Below, we’ll give you a deeper explanation of how POP and IMAP work and how they differ from SMTP.
POP stands for Post Office Protocol, and it’s used to receive incoming messages. The most current version is POP3, last updated in 1988.
This protocol gets its name because it operates like a real-life post office in the digital realm. POP3 will receive emails and hold them for clients until they pick them up. All emails are downloaded and stored locally, making it a handy solution for someone who only uses one computer to check emails. It’s also commonly used by businesses so employees can check emails while offline.
How do POP and SMTP differ?
- SMTP is a message transfer protocol, while POP is a message access protocol. In other words, SMTP is used to send mail from one user to another, while POP is used to receive emails.
- SMTP is used twice: Once when establishing the connection and sending information between the sender and the email server, and a second time when sending information and connecting to the recipient. POP is only used once between the receiver and their mail server.
IMAP stands for Internet Message Access Protocol. In short, IMAP stores messages on an email server, but this server can be accessed by the user to check and configure their emails. The difference between this and POP is that IMAP uses a cloud server so emails can be authenticated and categorized by any device. Many email users prefer IMAP to POP because of the convenience and efficiency.
If you’ve ever set up your own email client, you probably encountered IMAP on an interface like this one:
How do IMAP and SMTP differ?
- SMTP is a message transfer protocol, while IMAP is a message access protocol (like POP). So while SMTP sends messages and handles outgoing email, IMAP only retrieves messages and handles incoming email.
Running your own SMTP server vs. using a third-party email service: What’s best? #
When it comes to setting up and using an SMTP server, there are two main options:
- Run it yourself
- Use a third-party service
What’s the best option? There’s no black-and-white answer, as it all depends on your needs and resources. Below, we’ll take a look at both and highlight the pros and cons of each so you can determine which path to go down.
Running your own SMTP server: Pros and cons #
What sort of advantages or disadvantages can you see from setting up and running your own SMTP server? Here’s an overview, plus a bonus step-by-step guide to SMTP setup and authentication for a more detailed rundown.
- Pro: No sending volume limits. Many email service providers and internet service providers (ISPs) limit your daily emails, as do some web hosts. When you have your own dedicated SMTP, you can send as many emails as you need on an hourly or daily basis.
- Pro: Fully monitor email delivery. No matter what happens to your email after you hit send, you will receive helpful delivery information. You can see if your messages were sent to the recipient and examine any error codes.
- Pro: Your email list is private. Another advantage of running your own SMTP is that you don’t have to share email list information with anyone, maintaining your company’s and your customer’s data privacy.
- Con: Can take more time, money, and effort. Running an SMTP server requires a lot of resources: you’ll constantly need to monitor that everything is up and running, and may even need to hire a dedicated specialist or team—and that’s after you set up the server itself, which is a whole other story. For many businesses, this is simply too costly.
- Con: It’s local. Another disadvantage to running your own SMTP server is that it’s local, so it will be vulnerable to power outages or internet connectivity issues in your area. You can set up backup servers and failsafe protections, but again, this requires technical know-how.
- Con: You might experience deliverability and security issues. Unless sending to specific/limited receivers, it will take time to get the deliverability just right, especially when your email volume changes. Plus, you’ll have to protect your email server from unauthorized access and spam—and that can be a real challenge. That’s the big advantage of using a third-party service: they already have all of that stuff figured out, and have specific processes for detecting when adjustments are needed.
Speaking of which...
Using a third-party email service: Pros and cons #
Now, admittedly we are going to be a bit partial here, because at Postmark we do run a super-reliable email platform that you can use to deliver email via SMTP. This said, we also know that Postmark and other third-party services are not for everyone—so here is a list of the advantages and drawbacks of opting for a third-party email service.
- Pro: Significantly less hassle for you. Using a third-party email provider takes care of everything for you. You don’t need to have significant technical knowledge or spend time maintaining and monitoring your email server, and you can often tap into technical support to help with any issues.
- Pro: More secure. Most third-party providers offer multiple backup options to keep your emails safe if one server goes down. They also keep their security in line with the latest industry standards, ensuring your data is safe and secure at all times.
- Pro: More cost-effective. Paying for a service that you’ll use all the time means you never have to deal with email servers yourself. This can save your business time and money, since you won’t need to employ anyone to monitor and maintain your server or spend money fixing deliverability and security issues.
- Pro: More reliable deliverability. Third-party services have long-standing relationships with ISPs and mailbox providers, are experienced when it comes to solving issues and adjusting to the unique requirements of various receivers, have all of the monitoring and delisting processes in place, and of course have plenty of deliverability experts on staff—so you don’t have to worry about any of it.
- Con: Reliant on others. One of the only drawbacks to using a third-party SMTP setup is that you have to rely on another company if you run into issues with your email server. So if you go down this route, make sure to pick a service and team with great domain expertise—and who make great customer support a priority.
Pro tip: you can check the reputation of your provider on review sites like G2 or by checking out conversations on Twitter and other social channels. Real feedback from actual product users might give you a good idea of what to expect.
Aww. Thanks Val. 💛
- Con: Dealing with third-party terms and conditions. Finally, you’ll have to abide by the provider’s terms of service (TOS), which could include limits on the number of emails you can send. That said, it’s rare to find a TOS that will significantly reduce or impact your sending volume, whether it’s transactional email or promotional email.
Overall, opting for a third-party email service is the easiest and most reliable way to go for most businesses. It equals fewer risks and fewer headaches, allowing you to focus on your email strategy and send emails without worrying about the technical side of things.
Choose an email service you can count on #
Here’s the bottom line: The world’s email runs on SMTP, and while you can definitely set up your own SMTP server, it may end up being a bigger challenge than it needs to be—particularly if you have no prior knowledge of the inner workings of email protocols, don’t have a lot of resources, and are concerned about security. And even though here at Postmark we’re all excited about designing the perfect email infrastructure, we understand that most normal humans would rather not deal with it.
Most of the time, finding a third-party email service is the best bet, and if you choose Postmark you’ll have an email service you can truly count on. Our SMTP servers are distributed around the globe, giving you access to easy and secure email delivery at all times. And because we have serious street cred with inbox providers, we’re getting your emails delivered fast and reliably.
The best SMTP providers: A side-by-side comparison #
Looking for the best SMTP email service for your business? We compare features, costs, and ideal use cases of popular tools and share a handy comparison sheet that might help you as you do your research.
Ready to start sending?
Sign up for Postmark today and enjoy a free trial on us.
Start a free trial → No credit card required
Learn more about SMTP sending with Postmark:
- Postmark user guide: Sending email with SMTP
- How to send from Outlook using SMTP
SMTP or Simple Mail Transfer Protocol is an application that is used to send, receive, and relay outgoing emails between senders and receivers. When an email is sent, it's transferred over the internet from one server to another using SMTP. In simple terms, an SMTP email is just an email sent using the SMTP server.What you need to know about SMTP? ›
SMTP or Simple Mail Transfer Protocol is an application that is used to send, receive, and relay outgoing emails between senders and receivers. When an email is sent, it's transferred over the internet from one server to another using SMTP. In simple terms, an SMTP email is just an email sent using the SMTP server.How does Simple Mail Transfer Protocol SMTP work? ›
Simple Mail Transfer Protocol (STMP)
SMTP is used to send and receive email. It is sometimes paired with IMAP or POP3 (for example, by a user-level application), which handles the retrieval of messages, while SMTP primarily sends messages to a server for forwarding.
Originally, the Simple Mail Transfer Protocol (SMTP) used port 25. Today, SMTP should instead use port 587 — this is the port for encrypted email transmissions using SMTP Secure (SMTPS). Port 465 is also used sometimes for SMTPS. However, this is an outdated implementation and port 587 should be used if possible.What does SMTP use as transfer protocol? ›
SMTP stands for Simple Mail Transfer Protocol. SMTP is a set of communication guidelines that allow software to transmit an electronic mail over the internet is called Simple Mail Transfer Protocol. It is a program used for sending messages to other computer users based on e-mail addresses.What are the five mandatory commands used in SMTP? ›
- HELO/EHLO. The HELO command initiates the SMTP session conversation. ...
- MAIL FROM. The MAIL FROM command initiates a mail transfer. ...
- RCPT TO. The RCPT TO command specifies the recipient. ...
- DATA. ...
- NOOP. ...
- HELP. ...
- VRFY and EXPN. ...
There are majorly four components in the SMTP namely, Mail User Agent (MUA), Mail Submission Agent (MSA), Mail Transfer Agent (MTA), Mail Delivery Agent (MDA).What is the handshake of SMTP? ›
SMTP performs a handshake to establish a connection by using the HELO/EHLO command and the fully qualified sender and recipient domain names to ensure that the message will be deliverable. Once the connection is established, the MAIL command will respond to 220 Ready for mail.What is the difference between Snmp and SMTP? ›
Simple Mail Transfer Protocol - SMTP is a standard for email transmission used for monitoring and alerting you to the health of devices in your network. Simple Network Management Protocol - SNMP is an industry standard protocol for monitoring devices on IP networks.How secure is SMTP email? ›
By default, SMTP to send email lacks encryption and can be used for sending without any protection in place, leaving emails with an SMTP setup susceptible to man-in-the-middle attacks and eavesdropping from bad actors while messages are in transit.
The common protocols for email delivery are Post Office Protocol (POP), Internet Message Access Protocol (IMAP), and Simple Mail Transfer Protocol (SMTP). Each of these protocols has a standard methodology to deal with the emails and also has defined functions.How many ports does SMTP use? ›
What are the standard SMTP ports? There are four of them that are or were considered standard at some point. These port numbers are 25, 465, 587, and 2525. Other ports can also be used for SMTP transmission, but they're not usually the first choice for Internet Service Providers (ISPs).Why is SMTP protocol important? ›
SMTP helps prevent spam by verifying the sender's account before delivering an email. By preventing spam emails, SMTP also protects your IP reputation. SMTP increases delivery rate by restricting spam and protecting IP reputation. SMTP notifies senders if an email address is invalid or incorrect.Why do we need SMTP protocol? ›
The Simple Mail Transfer Protocol (SMTP) is used to deliver e-mail messages over the Internet. This protocol is used by most e-mail clients to deliver messages to the server, and is also used by servers to forward messages to their final destination.Does Gmail use SMTP? ›
For non-Gmail clients, Gmail supports the standard IMAP, POP, and SMTP protocols. The Gmail IMAP, POP, and SMTP servers have been extended to support authorization via the industry-standard OAuth 2.0 protocol.What are the three phases of SMTP? ›
- handshaking (greeting)
- transfer of messages.
Without an SMTP server, you cannot send your email to its destination. When you click the “send” button from your email client, your email messages get automatically converted into a string of codes and are transferred to your SMTP server.What is SMTP diagram? ›
SMTP is short for Simple Mail Transfer Protocol. It is an application layer protocol. It is used for sending the emails efficiently and reliably over the internet.What are the risks of SMTP? ›
Although SMTP is commonly used, the standard SMTP protocol has no security features, making it highly vulnerable to hijacking and other forms of attacks. The main concern is that malicious actors can gain unauthorised access to emails being sent and the sensitive information contained within the emails.Which file format is supported by SMTP? ›
RTF files can include information such as text style, size, and color. RTF format is a universal format.
SMTP AUTH will still be available when Basic authentication is permanently disabled on October 1, 2022. The reason SMTP will still be available is that many multi-function devices such as printers and scanners can't be updated to use modern authentication.What is SMTP authentication type? ›
SMTP Authentication, often abbreviated SMTP AUTH, is an extension of the Simple Mail Transfer Protocol (SMTP) whereby a client may log in using any authentication mechanism supported by the server. It is mainly used by submission servers, where authentication is mandatory.What is the first step in the SMTP process? ›
The process of sending mail can now begin. The client first submits the sender, and recipient's email address- the body of the email and any attachments, to the server. 3. The SMTP server then checks whether the domain name of the recipient and the sender is the same.What are the 5 types of SNMP messages? ›
There are five primary types of SNMP messages – TRAP, GET, GET-NEXT, GET-RESPONSE, and SET used as means of communication between the SNMP agent and the SNMP manager.What are the three types of SNMP? ›
SNMP has three versions: SNMPv1, SNMPv2c, and SNMPv3.What are the security weakness of SMTP? ›
As stated earlier, SMTP is insecure because it doesn't support encryption or authentication algorithms. This makes it very easy for scammers to send malicious emails with spoofed addresses. But then, a lot of email clients use this protocol.What happens when you send an email with SMTP? ›
So when you send an email with SMTP host Gmail or AOL, the SMTP server processes your email, decides which server to send the message to and relays the message to that email server. The recipient's inbox service provider, such as Gmail or AOL, then downloads the message and places it in the recipient's inbox.Do all emails use SMTP? ›
SMTP is used most commonly by email clients, including Gmail, Outlook, Apple Mail and Yahoo Mail. SMTP can send and receive email, but email clients typically use a program with SMTP for sending email.What protocol is used to retrieve emails? ›
IMAP and POP3 are the two most commonly used Internet mail protocols for retrieving emails. Both protocols are supported by all modern email clients and web servers.What is the basic protocol for email? ›
There are three common protocols used to deliver email over the Internet: the Simple Mail Transfer Protocol (SMTP), the Post Office Protocol (POP), and the Internet Message Access Protocol (IMAP). All three use TCP, and the last two are used for accessing electronic mailboxes.
A computer dedicated to running these applications is also called a mail server. Microsoft Exchange, Exim and Sendmail are common examples of mail server programs. A mail server works with other programs to create a messaging system.What is the limit of SMTP? ›
Gmail sending limits.
|Auto-forward mail filters Account filters that automatically forward mail||20|
|Recipients per message Addresses in the To, Cc, and Bcc fields of a single email*||2,000 total per message (maximum of 500 external recipients )|
Gmail: 25 MB per message. Office 365*: 100 MB per message. Generic SMTP (Sendgrid): 19.5 MB per message.
Additional throttling limits for the SMTP Authentication protocol are: 30 messages per minute. Recipient rate limit of 10,000 recipients per day.How many emails can Gmail SMTP send? ›
How many emails can you send from Gmail per day? For individual Gmail accounts, the daily send limit is 500 emails per rolling 24-hour period. If you're a typical Gmail user, you may not even know about this limit because it's doubtful you send that many emails in a typical day.How many emails can be sent from Gmail SMTP? ›
You may see this message if you send an email to a total of more than 500 recipients in a single email and or more than 500 emails sent in a day.What is SMTP server address? ›
The SMTP server address is the email address of your email provider. If you were to send an email, you would need to enter the SMTP server address on your email program to be able to send a message.What is SMTP server and how it works? ›
An SMTP server is a computer or an app that is responsible for sending emails. It functions following the Simple Mail Transfer Protocol (SMTP). An SMTP server receives emails from the email client. Then it passes them on to another SMTP email server and relays them to the incoming mail server.What is SMTP and why is it important? ›
SMTP (Simple Mail Transfer Protocol) is a common language used to send email. It's a universal set of rules that allow servers and email clients to communicate via the internet. Think of SMTP as the language your computer uses to tell a server where an email goes, what's in the email, what's attached, and more.What is SMTP and its purpose? ›
The Simple Mail Transfer Protocol (SMTP) is used to deliver e-mail messages over the Internet. This protocol is used by most e-mail clients to deliver messages to the server, and is also used by servers to forward messages to their final destination.
The Simple Mail Transfer Protocol (SMTP) is an application used by mail servers to send, receive, and relay outgoing email between senders and receivers.Is Gmail A SMTP server? ›
The outgoing SMTP server, smtp.gmail.com , supports TLS. If your client begins with plain text, before issuing the STARTTLS command, use port 465 (for SSL), or port 587 (for TLS).Does SMTP use DNS? ›
The Domain Name System (DNS) is a directory used by SMTP to convert a name, such as renovations.com, to a list of servers that can receive connections for that name and to find the IP address of a specific server.Does SMTP require a server? ›
Without an SMTP server, you cannot send your email to its destination. When you click the “send” button from your email client, your email messages get automatically converted into a string of codes and are transferred to your SMTP server.What are the basic drawbacks of SMTP? ›
The main drawback of sending through an SMTP server is that it is insecure, it can be easily hacked. There are so-called “fake emails” that are messages sent using any address (for example email@example.com) to any recipient. Another disadvantage is the server limitation.What are the three phases of SMTP with example? ›
To transfer mails, SMTP uses three phases, i.e. connection establishment, mail transfer and connection termination and commands, which are used to send data from client to server and responses, which is used to send data from server to client. It can transmit a message to more than one recipient.Why SMTP is not used to receive emails? ›
It takes the information it has and gives it to other computers, which lets it find the correct inboxes for delivery. But SMTP servers don't work in both directions; they can only deliver outgoing mail, not receive incoming messages. The counterpart for receiving emails would be POP3 or IMAP.