Setup Your Own Simple SMTP Server — How To
hMailServer Earlier today, I created a PowerShell handwriting to do a number of activities. As the script runs unattended, I needed to know if an error was encountered. So my first think was to send an e-mail. Sure, no problem, sending an electronic mail with PowerShell is a snap. Wait a minute, I needed an SMTP server. What should I do ?
- I could use the SMTP server from my work. As it is my company’s SMTP server, not the best choice for personal needs.
- I could use the SMTP with GMail. The SMTP with GMail is simple but it uses SSL and requires my username and password for GMail. I have no desire to have my password in a PowerShell script.
- I could look into alternatives to GMail. More than likely, the alternatives will be similar to GMail.
I decided to run my own SMTP server. I set out on my search for SMTP server software. After a morsel, one intersection in finical catch my eye. hMailServer is a knock-down little joyride that is free and open-source.
I started with reading the documentation. It was not excessively detailed and I felt it left a bunch to the imagination of the lector. I am not the type of person to shy away from a challenge. After a bit of clock time, I had my very own SMTP server .
Some internet service providers (the people that offer you the internet connection) block outgoing traffic on port 25. Since outgoing traffic on port 25 is required for email to work properly, you either need to convince your ISP to open up port 25 for you (if it’s not open), or you need to configure hMailServer to forward all email through your ISP’s email server.
If you barely want to run your own dim-witted SMTP waiter, I am going to provide some steps. These steps are the accurate steps I performed on an old Windows 10 laptop a few hours ago .
Download and Installation of hMailServer
As with all software, a download is required. so open your browser and navigate to https : //www.hmailserver.com/download to get the latest and greatest version of hMailServer .Download hMailServer from hMailServer.com After the download is complete, a quick double-click on the installer to start the initiation . When at the Select Components window, ensure Server and Administrative tools are both control. These options should be checked by default . At the future window, you will need to make one of the biggest choices for hMailServer. The software utilizes a database so you will need to select the database to use. If you just want something agile and simple, barely use the built-in database, which should be checked by default . One of the biggest features with hMailServer is security. During the initiation, hMailServer will create a default drug user with administrative rights. You will need to enter the password for the default user . We are at the end of the install sorcerer. If you are ready, click the Install button . The installation of hMailServer should take no more than a couple of minutes. When the installation is completed, ensure “ Run hMailServer Administrator ” is checked and click the Finish button .
Configuration of hMailServer
The hMailServer Administration window should have launched when clicking the Finish button. Remember the notification from the install ace that a default exploiter would be created. And we were asked to enter a password. here is where we will use the password .Connect Window for hMailServerPassword Entry for hMailServer We are quick to start the actual configuration of our SMTP server. The first step should be relatively obvious. Can you guess the firs step ? If you aren ’ metric ton surely of the adjacent step, just spirit at the window — Getting Started. Click the “ Add domain… ” button . Under the General tab key, we need to enter our domain name. I do not own a world so I decided to use a juke sphere. An actual sphere is not required to send emails. If you use a fake world, be careful to enter a knowledge domain that does NOT exist . Click the Save button. Click the + release next to Domains. Click on Accounts. here is where we will configure an account. Enter a mention under the Address field. The name can be whatever you want. additionally, enter a password in the Password discipline. If the password is decrepit, hMailServer will prompt if you want to use the password when save . Click the Save button. Click the + adjacent to Settings. Click Protocols.
Read more: Apollo for Reddit
For our needs, we are wanting an SMTP waiter. So feel loose to uncheck POP3 and IMAP . Click the Save button. Click the + next to Advanced. Go ahead and insert localhost under Default Domain . Click the Save button. Click on Auto-ban. The Auto-ban have is designed to block IP addresses after excessively many failed login attempts. This SMTP server is our personal SMTP waiter and we will be doing tests. I would recommend unchecking the “ Enabled ” box . Click the Save button. Click on IP Ranges. The default values will be “ My Computer ” and “ Internet ” and will look alike to the values below . Click on TCP/IP Ports. This window wil show the ports configured for SMTP, POP3, and IMAP . That wasn ’ t so bad, was it ? We are closely complete with our shape. One end step that is very significant. Click the + future to Utilities, Click Diagnostics. hera is where we are going to test our configuration. Under “ Select the domain you want to run tests on ”, select the domain we entered earlier. No motivation to change any other settings. Press the Start button . We configured hMailServer with basic options. Do not be surprised to see what errors in the window. For exemplar, “ error : Backup directory has not been specified. ” We didn ’ metric ton create a backup directory so no surprise on the mistake. We need to look for two specifics tests :
- Collect server details — The results of this test are the verison of hMailServer version and type of database
- Test outbound port — The results of this test are extremely important. The SMTP server needs to be able to communicate. If an error is encountered during this verification, we need to do some troubleshooting.
now you have a simple SMTP waiter for your own needs. Feel free to use as you wish. At the start of the article, I mentioned a PowerShell script that would use the SMTP waiter to send emails. If you are interested in the actual PowerShell code that I used, here it is .
$ ServerAddress = “ mail.local ”
$ From = “ jabberwocky @ mail.mydomain ”
$ To = “ wendigo @ gmail.com ”
$ SMTPServer = “ 127.0.0.1 ”
$ SMTPPort = “ 25 ”
$ Username = “ jabberwocky @ mail.mydomain ”
$ Password = “ mypassword ”
Read more: How to register as a VIP in GTA Online
$ SMTPMessage = New-Object System.Net.Mail.MailMessage
$ SMTPMessage.From = $ From
$ SMTPMessage.To.Add ( $ To )
$ SMTPMessage.Subject = “ here is the e-mail ”
$ SMTPMessage.IsBodyHtml = $ dependable
$ SMTPMessage.Body = $ EmailMessage $ SMTPClient = New-Object System.Net.Mail.SmtpClient ( $ SMTPServer, $ SMTPPort ) ;
$ SMTPClient.EnableSSL = $ false
$ SMTPClient.Credentials = New-Object System.Net.NetworkCredential ( $ Username, $ Password ) ;
$ SMTPClient.Send ( $ SMTPMessage )
If you have any problems, hMailServer has software documentation and forums which can be of a bang-up help oneself .