This post was published to Dan Keeling on SharePoint C... at 12:36:06 PM 7/27/2009
Setup SMTP for your development SharePoint Environments
After wrapping up a project recently, a request came up for testing some custom email alerts, and email alerts from Workflow.
In the client’s development environment email was enabled, but there were some problems with the workflow. I had been working independently on my own VM, which was not on the domain and was not setup to send emails. So, to better test these things, I setup SMTP. I happened to know first-hand what an open/anonymous relay meant, and wanted to avoid that at all costs. After a little reading about settings and what to avoid, including sites that check for anonymous relays, I was off to setup the service and get things going. I thought I would just post some steps so that you can avoid mistakes, and get your SharePoint development VM’s sending emails. (Currently, at this specific client, they block SMTP, so I am running the local POP and SMTP service, so that I can check my emails.)
See this post on how to install the SMTP service. (Just like turning on IIS).
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e4cf06f5-9a36-474b-ba78-3f287a2b88f2.mspx?mfr=true
Now after the service is running, open IIS manager. See the new area for Default SMTP Virtual Server:

Right-click on the “Default SMTP Virtual Server” and choose Properties.

Click on the Access Tab.

Let’s go through each area, in Authentication:

We want to enabled Anonymous access and Integrated Windows Authentication, don’t worry, we will restrict access to this server in a second, so you will not have an anonymous relay.
Click Ok.
![clip_image006[1] clip_image006[1]](http://lh5.ggpht.com/_lzVw9gP-76o/Sm3qrOMvddI/AAAAAAAAAKw/WGKaBLXhSMw/clip_image006%5B1%5D_thumb.jpg?imgmax=800)
Click on Connection

Select the option for “Only the list below”, then add an entry as shown above, thus allowing only this local computer to access the SMTP service.
You can also add other local computers that you also wish to relay, just be careful, if you are on a laptop moving around from network to network.
Click OK.
![clip_image006[2] clip_image006[2]](http://lh3.ggpht.com/_lzVw9gP-76o/Sm3qs_wes4I/AAAAAAAAALA/AAWbwWeInks/clip_image006%5B2%5D_thumb.jpg?imgmax=800)
Click on Relay

Select “Only the list below” and check “Allow all computers which successfully authenticate to relay, regardless of the list above.”
***Open relay or not???***
We are allowing everybody to relay, and we have anonymous access enabled, so are we are an open relay? NO, the restriction from the Access area is not allowing connections from other computers than this server, so we are not actually an open relay!
Click Ok.
![clip_image006[3] clip_image006[3]](http://lh3.ggpht.com/_lzVw9gP-76o/Sm3que7ABnI/AAAAAAAAALQ/iI0zs9j-eDU/clip_image006%5B3%5D_thumb.jpg?imgmax=800)
You can change other settings if you like, I just wanted a vanilla SMTP server running so I can get mails to send from SharePoint.
Click OK.
Now, our SMTP server will allow us to send emails from this computer and they will be relayed, but to where? We now need to define Relay Domains.
Expand the node for the “Default SMTP Virtual Server”.

Click on Domains
This list will only show the name of the local computer, so we need to add a couple other domains.
Right click and select New->Domain.

Select “Remote” and Click Next

Add *.com to allow for mail to be relayed to any .com address.
Follow the two previous steps to add .org and .net as needed. (Or for .tv, etc.)

That’s pretty much it! Set this server as the SMTP server in Central Administration, and you are ready to go.
A couple things to note, there is now a new folder at “C:\Inetpub\mailroot”, which contains the drop folder, queue, etc. You can also enable logging if you run into problems. I keep logging turned off on my box, I need to keep the space small.
Test your setup! Create a new AD account, add an email address for something at Gmail, or Hotmail, etc. Then add the user to any site and add an alert for that user, create an item in that list and you should get an email from your SharePoint server.
Hope it helps.