Configuring an SMTP Server for SharePoint

Harnessing Simple Mail Transfer Protocol for SharePoint

Need a Mail Server for SharePoint but don’t have a spare dedicated Mail Server? No problem! You can just use your SharePoint Server for mail with some relatively simple configuration adjustments!

First, you will need to decide which server or servers will be the mail server in your Farm. This will typically be the Web Front End, but can change depending on your SharePoint topology and needs. This server will need to have the IIS 6.0 and SMTP feature installed. This will be your first step.

Next, you must configure the SMTP and SharePoint configuration. You will first need to create an Alias in SMTP. To do so, open IIS 6.0, Expand SMTP Virtual Server, right-click Domains and select New and Domain. In the New Domain Wizard, select Alias and give your SMTP Server a name. This can really be almost anything, but I personally will usually go with something like mail.servername.

New SMTP Domain Wizard

Now, we need to set some basic SMTP permissions. While IIS 6.0 is already open, we will right-click SMTP Virtual Server and select Properties.  Now select the Access tab as seen below:

SMTP Virtual Server Access Tab

Click the Connection tab and ensure that ‘All except the list below’ is selected, with no entries in the list. This is signifying that the server will accept connection attempts from any server. This may sound like a security risk, but we will be using the Relay setting to secure this now.

Now select Relay as seen in the picture above and select only the list below. In the list, make sure you include 127.0.0.1, and any IP addresses of Web Front End’s in your SharePoint Farm on the Interface that talks to the server you are currently on. Now restart SMTP and SMTP should be configured. By changing what we will allow to relay, we have effectively limited any relay services to only servers in the SharePoint Farm, meaning we have not configured the dreaded Open Relay.

Now we will open and edit the hosts file. This is so we can make the Relay rule true for the mail server. This file is located at the following location:

C:\Windows\System32\drivers\etc\hosts

We will need to edit this hosts file as follows:

SMTP Edit the Host File

**Remember that mail.servername is actually the Alias you set previously. By saving this entry to the hosts file, we are making this resolve to 127.0.0.1. Not only does this tell the server to send mail to itself, but it also makes the 127.0.0.1 Relay rule true, which allows the server to relay off of itself. Also, if your environment will only have this mail server, but multiple Web Front Ends, you will need to edit the hosts file of each Web Front End server to use this server’s internal IP for mail.servername.

Now it’s time to configure SharePoint with the correct information. To do so, start by opening Central Administration. Click on System Settings and then Configure outgoing e-mail settings.

Configure SharePoint Outgoing Email Settings

As you can see above, you will use the mail.servername for the Outbound SMTP server.

The From address can really be whatever you want. However, be aware of your recipients and if they require PTR or RDNS (additional email security), and configure this accordingly. You typically won’t have problems if you make this address something different than that of your recipients, but otherwise this can be completely faked for the most part.

The Reply-to address should be an email address that already exists that you access frequently. However this can be faked as well if you do not want return emails.

Leave the default Character set as UTF-8.

That’s it! You have now configured Outgoing SMTP for your SharePoint Farm.

To configure Incoming as well is very similar. You will simply navigate to System Settings then Configure incoming e-mail settings in Central Administration. For Enable sites on this server to receive e-mail select Yes; for the E-mail server display address: use any domain that you have configured appropriate MX records for as you can see from below. (You will need to point an MX record for the domain you use at this server’s external IP address). All other settings can be left as default.

SMTP Email Server Display Settings

**To make multiple mail servers, you need to perform each step for each mail server.  Then ensure that the outgoing e-mail, incoming e-mail, or both timer jobs are running on each mail server, (you only need the timer jobs for the services you are actually using). Some items, such as setting MX records, PTR and/or RDNS, are DNS related and outside the scope of this posting. However quick descriptions for these records can be found online and help for configuring these records is highly individualized and assistance can usually be found from your DNS provider.

Hope this helps! Thanks for reading!

VN:F [1.9.22_1171]
Rating: 9.3/10 (6 votes cast)

About Eric Lough

Eric Lough (known as ELough) has sharpened his craft as one of Fpweb.net's trusted go-to guys on the Support Team. ELough focuses on trouble tickets, while at the same time expanding his knowledge of SharePoint configuration by actively participating in new builds and SharePoint events. Outside of SharePoint, you'll find him gaming (electronic or physical), being the IT guy for his family, or spending time with his daughter Kaylee, who also enjoys gaming on all platforms (especially Mario Bros. for the Wii at the moment). At 31 years old, ELough has spent most of his 20’s in the IT field and drifted into the SharePoint arena about five years ago. His CNS or ‘Networking’ background translated well to SharePoint as the platform emulates a “network” by communicating between various software on a large scale. This piqued his interest in both where SharePoint will go in the future and where it’s been in the past, and ELough’s mission is to know the beast inside and out.
This entry was posted in SharePoint Tips & Tricks and tagged , , , , , , , , . Bookmark the permalink.

10 Responses to Configuring an SMTP Server for SharePoint

  1. SPJeff says:

    Great post Eric. To enable both outbound and inbound email on SharePoint I’ve found hMailServer to be really helpful for IMAP demo inboxes and SMTP forwarding (inbound email). Feel free to take a look at:

    http://www.spjeff.com/2011/02/05/how-to-free-internal-sharepoint-email-imappopsmtp-inbound-and-outbound/

  2. Eric Lough says:

    Very Nice! Thank you for the compliments as well Jeff! I had never attempted to use hMailServer but it appears to be rather more robust than SMTP only. I wonder if the functionality could be extended by the availability of other mail protocols in hMailServer? I do like how you explain the mail client aspect as well as how to configure it. Cheers!

  3. Pram says:

    how to identify if the SMTP relay service is stopped, it does not log anywhere. I need to make smtp server more fault tolerant, can we configure more than one server as SMTP server

  4. Eric Lough says:

    @Pram
    Hello Pram,

    Sorry for the late reply! Yes you can configure multiple SMTP server’s to provide redundancy. For outgoing email this would be to simply install SMTP on each server, and mark 127.0.0.1 as the name of the outgoing email server in each server’s hosts file. For incoming, you will want the incoming email server name to be an alias on each servers’ SMTP configuration, and have your MX record for the email domain resolve to the load balanced IP address. You will also need to add the load balanced IP address to the allowed relay settings in SMTP. (You can use MX record configurations to bypass the need for a load balanced IP however).

    So you can have multiple SMTP servers for both outgoing and incoming. You just basically do everything in the article twice. For incoming, you only need to have a special consideration for a load balanced IP, (can be Windows NLB, other NLB software, or Hardware NLB), and the MX record needs to utilize this NLB IP. You can actually circumvent the need for an NLB IP by manipulating your MX records if this is a concern. I have a blog post here that describes how to manipulate MX records:
    http://blog.fpweb.net/dns-records-management-what-about-mail/#.VMu0VS5KYu8

  5. Helpful data shared. I am extremely happy to read this write-up. thanks for giving us good info. Great walk-through. I appreciate this post.

  6. Pingback: Configuring STMP Service in SharePoint 2010 Server | SharePoint Blog by remandlo

  7. Mafeer says:

    is there any other third party SMTP sevrer same like IIS SMTP Server you
    for Sharepoint ?

  8. Shirlene Spillane says:

    my business was requiring a form some time ago and discovered an excellent service that has a lot of fillable forms . If you need to fill out it as well , here’s http://goo.gl/NyzWRC

  9. Latifa says:

    Hello Eric,

    I have mail server online 365 and I did configure the connector to connect to smtp relay sharepoint 2010.
    The mail is received by iis on wfe but it put the mail file in the bad folder instead of drop one!
    I have mail in the office 365 and I am using smtp relay for outbound emails !
    now I need to have incoming email to sharepoint 2010 and email is received by the iis sharepoint wfe but not inserted in the drop folder instead in the bad folder!

    Thank you
    Any hint or help!

  10. Latifa says:

    Hi,

    Incoming mail to sharepoint 2010, email is received by iis in the queue folder but it is replaced in the bad folder instead of the drop.
    outlook server on the 365 and I am using smtp relay to wfe sharepoint 2010. I have application server and wfe.

    Any hint !
    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

Let's make sure you're human first: *