Simple Mail Transfer Protocol: How to create an outgoing SMTP server.
You've just set up your outgoing mail SMTP server and sent bulk emails to your customers. You are ready to receive email and to get answers and orders and you are clicking "Get new messages" button, but something is wrong - you have not received any emails at all.
Don't panic - there is a solution. This article will tell you some secrets that will help you not only to send, but also to get messages with your local outgoing mail SMTP server. Of course, this comic situation is just a joke and you have to make sure you set up your server for receiving before you send.
Make sure you have provisions for your server to run 24/7 without interruptions, because you do not know when somebody might send you a email message, so your server has to be up all the time waiting for anything to arrive. Of course, if it goes down for a few minutes, it's not critical, since all servers are programmed to retry each email message many times.
Get static IP.
If you read the previous articles you will know, that the main thing you should do is:
"Get a static IP from your provider!"
IP is like your postal address - if you have it, a "postman" will not pass through your mailbox. So, if you talk to your provider and get a static IP, your messages will not miss your server.
If your outgoing mail SMTP server is behind a router or Network Address Translator (NAT), you will also need to set up a static IP for your PC in addition to the above.
Add DNS record.
Your server will have no ability for e-mail receiving, if you forget just one DNS record, called MX record.
MX record (or mail exchanger record) specifies a mail server responsible for shows messages to the addresses in the specified domain. The set of MX records of a domain name specifies how e-mail should be routed with the SMTP.
Let's see an example: your domain is "josh.com
* your IP is "126.96.36.199"
Your MX record will look like:
* "josh.com MX 10 mail.josh.com" (10 is a priority. If you have just one IP, this doesn't matter too much
Then this record resolves as A-record to your IP and it looks like:
* "mail.josh.com A 188.8.131.52"
This means, that any server looking to deliver a e-mail to "peter" on "josh.com" will find, that josh.com is correctly introduced by an IP 184.108.40.206 and will be able to connect and deliver the e-mail.
Check your router.
The next step is useful to router users. If your computer or server is connected to the router, it's not enough to get static IP and to add MX record. It is necessary to configure your router as well.
Usually, your router forwards incoming packets on it's own, but if you do not specifically set it up, there is no guarantee that incoming connections on port 25 will be transferred to your PC.
To help your incoming mail not to get stuck, you need to configure forwarding of your e-mail received from your router to your internal IP. Internal IP is your computer's static IP and you have to set it up by yourself. For example, your router's IP is 192.168.1.1 (as usual) and you stated your internal IP as 192.168.1.105 (you must hard code it in the Windows settings).
So, you need to check your router has route for port 25. (port 25 => 192.168.1.105). This means your router will forward any traffic, that comes to your router on port 25 (your port for e-mail receiving) to your internal static IP.
Each type of router is slightly diverse, but most of them are pretty standardized with the way to configure it. You need to access your router, using your web browser by connecting to your router's internal, private IP and then refer to it's internal documentation for configuring port forwarding or application sharing (diverse brands would name this same activity differently).
Check protection suits.
Always check your built in Windows Firewall, internet security suits, protection and antivirus software. From time to time they may block your incoming traffic so pay particular attention to them. Some firewalls may alert you when some software is trying to connect outside or is getting a connection from outside, but since you may not be in front of the computer's screen when such message arrives, we recommend allowing all traffic on needed ports manually, or even excluding your outgoing mail SMTP server from your firewall checks completely.
Add your local domain and local users.
Now you need to tell your outgoing mail SMTP server, that you will want to accept messages for certain domains. Different mail servers have different way of doing this, so we will show you how it can be done, using our own SMTP server software. Setting up your local domain and your local users gives you the ability for e-mail receiving with your outgoing mail SMTP server and it couldn't be easier, just don't forget to give them their private usernames and passwords.
Please remember to add just the domain part. For example, if you are planning to accept email for "peter" on "josh.com", then you must create a domain called "josh.com" and inside this domain, create a user called peter.
Setup your email client.
Now your outgoing mail SMTP server is ready to receive your emails and you just have to customize your email client to read your messages.
To do this open your Windows Mail or email client you prefer and:
* Enter the name you would like to appear in the "From" field of your outgoing messages (for example "Josh" or "Peter")
* Enter your email address - you've just set it up in SMTP server's "Local users" field
* Setup IP or hostname of your mail server as SMTP or POP3 servers. If you have installed your SMTP server on the same machine as your mail client, you can just enter "localhost" (or 127.0.0.1) as a hostname.
* Enter you user name and password given to you in your SMTP server's "Domain users" menu item.