Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at
Configuring IIS 6.0 to send mail via SMTP for applications

Enabling smtp services for IIS is well documented, but configuring in my environment was more difficult than I would have thought it would be... So this post is partly a note for me as we will be changing out gear soon.

Our environment is not very exotic...a box acting as an web server, and another box acting as an exchange server. Both are running Win2003.

First, smtp services must obviously be enabled/running. Here is how.

Next, in IIS, select the new SMTP Virtual server node and right-click/Properties/Access/Relay. Be sure 'Only the list below' is selected and add '' (localhost) to your Computers Access list . Finally, deselect 'Allow all computers which successfully authenticate...'. Be very careful not to turn your server into a relay server unless you like being blacklisted .

Now, at this point I was able to get my mail sent to domains outside my own. So if my webserver was and it sent mail to then all worked just fine. But I was unable to send mail internally to other mail accounts (

What I failed to do was set up a SMART HOST to route mail to my exchange box.

To do that, right-click the smtp node in iis/Properties/Delivery/Advanced. Enter the name of the server hosting exchange and deselect 'attempt direct delivery before sending to smart host'.

Posted 05-07-2008 10:29 PM by Michael Nichols
Filed under: , ,



Vaclav Elias wrote re: Configuring IIS 6.0 to send mail via SMTP for applications
on 05-08-2008 5:07 AM

Hi Mike,

I was able doing this without installing (SMTP services) and setting  SMTP Virtual Server. We have got also the same boxes.

I have only set this in my web.config:



           <smtp deliveryMethod="Network">

               <network password="passoword" userName="username" host="exchangeServerIP"/>




This works both for external and internal email sending. Not sure which way is recommended. Obviously your solution works globally. I have to set this for all websites unless I would put it into machine.config.

We have set also the relay IP address of the web server on the exchange server and some configuration on firewall as the web server is in DMZ.

Maybe this info will be also handy for someone..



Stephan wrote re: Configuring IIS 6.0 to send mail via SMTP for applications
on 02-12-2009 10:25 PM

Hi Mike

I was having the same issue as you, and followed your step and it solved my problem perfectly.  Thank you.


- Stephan

george wrote re: Configuring IIS 6.0 to send mail via SMTP for applications
on 06-22-2009 6:23 PM

Vaso, this method works better than your web.config method when the mail server is physically located on a different server.

Sending mail to an external mail server directly from will not queue the message if the mail server is down, instead it will fail.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)