We highly recommend using an external mail service for the best chance of your website emails being delivered.
These external providers monitor their IP Addresses for abuse and work hard to keep them out of the blacklists, when running your own SMTP service this is a trap that is really easy to fall into, once your IP Address ends up on a blacklist, it is extemly hard to keep it out.
We recommend MailGun as our preferred provider for SMTP services, we use them with our shared hosting service, however SendGrid is also used by many websites too.
Enable SMTP Service
First we need to install the SMTP Service, you can skip this step if you have already done this.
- Go to Start > All Programs > Administrative Tools > Server Manager
- Click Features in the navigation pane.
- Click Add Features to start the wizard.
- Scroll down the list to the SMTP Server, and check the box. The Required Role Services dialog will appear, listing all of the dependencies that the SMTP server depends on to operate. Click Add Require Role Services.
- Click Next twice.
- Review the list of available IIS Role Services and check any that you would like to add.
- Click Next then click Install.
Configure SMTP to Relay Outbound Email via MailGun or SendGrid
- Go to Start > All Programs > Administrative Tools > IIS 6.0 Manager.
- Right click on the SMTP Virtual Server #1 and select Properties.
- Click the box to enable logging section to assist you in configuring the server.
- Select Properties and check the box to activate Use Local Time For File Naming And Rollover option.
- Select Advanced and check the following items: Date, Time, Client IP Address, User Name, Service Name, Server Name, Server IP Address, Server Port, Method, Protocol Status, Bytes Sent, Protocol Version, and Host.
- Click OK.
- Click on the Access tab the select Relay in the Relay Restrictions section.
- Click Add, enter 127.0.0.1, and click OK. The IP appears in the list with Access Granted.
- Click OK Only The List Below and enter 127.0.0.1 in the IP address field.
- Click OK to return to the Access tab as shown in the previous screenshots.
- Select Delivery and click Outbound Security.
- Select Basic Authentication and if your using MailGun enter your SMTP credentials which you can find in your MailGun or My.UmbHost account, for SendGrid enter
apikeyas your username and the password will be your SendGrid API Key.
- Click OK.
- Click Advanced.
- In the Smart host field: if your using MailGun it will be either smtp.mailgun.org or smtp.mailgun.org, for enter smtp.sendgrid.net
- Click on OK twice and you can close the IIS 6.0 admin MMC
Testing The Configuration
Open up a telnet client within Windows, you can do that by entering the following into Command Prompt
telnet localhost 25
Now, with telnet running, enter the following commands just as you see them, pressing ENTER for each new line (if configured correctly, the server won't do anything until you enter the period):
EHLO yourdomain.com MAIL FROM: [email protected] RCPT TO: [email protected] DATA This is a test email for relay operations. .
If these commands work, then you should have the following success code returned:
250....Queued mail for delivery