How Email Works and Explained With An Easy SMTP Example
If you are running a business and want to take your email marketing to the next level, then you need to either have your own dedicated SMTP server or subscribe to a third-party SMTP service. While running your own SMTP server is undoubtedly a big investment as you can reap the benefits for a long time, it still takes a lot of time and effort in managing it. However, with commercial third-party SMTP services, you just subscribe to the service and start using it right away.
But the issue with commercial SMTP providers is that you don’t have complete control over the server. While the service provider guarantees the safety and security of your emails, the server is still shared by more than one business, and hence there are some hidden risks involved. Have you ever wondered what happens behind the screen when you get a popup “You’ve Got Email” or when you click the send button?
What Is An SMTP Server?
SMTP (Simple Mail Transfer Protocol) is a protocol that takes care of sending emails and, by default, uses SMTP port 25. POP3 or IMAP protocol is used for receiving emails.
What Happens When You Click The “Send” Button?
A lot happens in the background after you click the send button. Everything happens in just a few seconds, and no one ever bothers to wonder what exactly happens behind the scenes. Let’s try to untie the knot and will try to explain things in a simple manner:
- Let’s imagine User ABC wants to send an email to another user XYZ.
- So, ABC composes his email from his address email@example.com to firstname.lastname@example.org.
- Once he clicks the send button, the SMTP email server springs into action.
- The first step is that the mail gets transferred from the Mail User Agent (MUA) to the Mail Submission Agent (MSA) using the SMTP protocol on SMTP port 25.
- Next, the mail gets transferred from the Mail Submission Agent (MSA) to the Mail Transfer Agent (MTA).
- The MTA is the last boundary of the SMTP server, which decodes the email to lookup the DNS from the Mail Exchanger and tries contacting the domain name using the IP address.
- It seeks to establish a connection with the recipient SMTP server.
- Once the connection is established, the MTA hands over the email to the Mail Delivery Agent (MDA)
- Mail is delivered to the local SMTP server – free or paid and is stored there.
- The local Mail User Agent (MUA) takes care of transferring the email to the recipient inbox.
- In the receiving end, either POP3 or IMAP can be used for receiving the emails.
- With POP3, the email will be completely downloaded to the user’s system and deleted from the mail server.
- But with IMAP, only a copy is downloaded, and the original is retained in the mail server.
- There are instances when the mail gets delayed due to various reasons. During that time, every mail server has a mail queue where the delayed email gets added to the queue. The Mail User Agent tries contacting the email client to deliver in scheduled intervals.
- If it succeeds, the mail gets delivered, and if it fails after some attempts, the email is handed over to the sender Mail Transfer Agent and treated as a bounced email and sent back to the user who had sent the mail.
- There may be various reasons that an email gets bounced, including invalid address, sender reputation, blacklisted IP, etc. The reason for the email bounce will be specified in the bounced email to enable the user to rectify and send the email back.
How To Setup Your SMTP Server?
If you’ve decided to install your own SMTP server, and when it comes to private SMTP servers, there are many open-source SMTP servers available. As an SMTP example for this post, we’ll be using a popular mail server, hMailServer. Here is how you can set it up:
Step 1) The first step in setting up your own SMTP server is to download hMailServer. You can download it from here
Step 2) Once it is downloaded, install the software in your system
Step 3) During installation, ensure the following:
- “Full installation” is selected
- Server and Administration Components is selected
- Choose “built-in database engine” when it asks to select a database server type
- Create a password for hMailServer
Step 4) Once the installation is over, it is time for configuring the SMTP server
Step 5) Launch the hMailServer and click “Connect” and enter the password you have chosen during installation
Step 6) Click the “Add Domain” button and specify your domain name
Step 7) In the Accounts tab, click add to create a new account by entering your account name and password
Step 8) In the Setting tab, under Protocols à SMTP, click “Delivery of Emails” and specify the local hostname which should be something like “mail.yourdomain.com”
Step 9) Under Remote Host Name, specify the SMTP Relayer if you have an SMTP relay address
Step 10) To test your SMTP server is working, open command prompt and type in telnet mail.hmailserver.com 25
Step 11) If it returns, “could not open a connection to host”, then you need to check with your ISP, or else SMTP port 25 is open, and you are all set to send your first email address
Step 12) Additionally, you can add your IP ranges, install spam filters, anti-virus and other necessary tools
Setting up your own SMTP server – free has never been as easy as it is today. But to ensure that your SMTP server maintains a good reputation and doesn’t get blacklisted, you need to install spam filters and monitor it regularly. Hope the above article with an SMTP server example has answered all of your questions about “what is my SMTP server?” and how you can easily set your very own SMTP server.
Join the thousands of organizations that use DuoCircle
Find out how affordable it is for your organization today and be pleasantly surprised.