But, finding "Default SMTP Virtual Server" was tricky ;)
Even if you use IIS7 to deploy your web site, you have to open IIS6 Manager to configure SMTP server (why?).
I configured SMTP server as follows to make things work:
Open IIS6 Manager using Control Panel --> Administrative Tools.
Open SMTP Virtual Server properties.
On General tab, Set IP address of
the Web server instead of "All
Unassigned".
In Access tab, click on Relay
button, this will open Relay
Restrictions dialog.
In relay computers list, add the
loopback IP address i.e 127.0.0.1
and IP address of the Web server, so that they can pass/relay emails through the SMTP server.
I was facing the identical problem and followed the (very clearly spelled out) steps in Vinod's reply, however this then created a different error:
Unable to read data from the transport connection: net_io_connectionclosed
I did a bit more digging and poking around and (while I'm not sure why this worked) I solved it by:
- Going back into IIS6.0 management console
- Open SMTP Virtual Server properties
- On General tab, changing the 'IP Address:' setting back to '(All Unassigned)'
Not sure why this works, but hopefully will help out someone facing the same problem in the future.
I got the same error as Mick Byrne when I followed the steps above. Turning it back to All Unassigned sorted it but I had to tweak a few other things as well:
Add the user my site was running under to the users on the Security Tab in SMTP Virtual Server.
Changed the value in the mailSettings > network > host attribute in my web.config to the specific server IP (for example 192.168.100.120) as opposed to localhost (which was pointing at 127.0.0.1 in the hosts file).
Hope this saves someone a few mins of messing about.
When you find the IIS6 manager (I have found that searching for IIS may return 2 results) go to the SMTP server properties then 'Access' then press the relay button.
Then you can either select all or only allow certain ip's like 127.0.0.1