ASP.NET 2.0 Beta 2: Configuring SMTP Settings
Playing with ASP.NET 2.0 today, and although I appreciate the intent of the Web Site Configuration tool, it still isn't working in this build. At least in the VPC I'm working in, my attempts to set the SMTP settings (so ASP.NET can send email to change a password) failed with compile errors. Clearly, the code associated with this site is attempting to use classes that don't exist in the framework.
Luckily, a little sleuthing in machine.config found the solution: If you want to be able to send email to send out a password reminder or new password, you can add the necessary section to your Web.config file manually.
<mailSettings>
<smtp deliveryMethod = "Network" [Network | SpecifiedPickupDirectory | PickupDirectoryFromIis]>
<network
defaultCredentials = "False" [true|false]
host = "" [String]
password = "" [String]
port = "25" [number]
userName = "" [String]
from = "" [String]
/>
<specifiedPickupDirectory pickupDirectoryLocation = "" [String]/>
</smtp>
</mailSettings>
My web.config file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<authorization>
<deny users="?" />
</authorization>
<roleManager enabled="true" />
<authentication mode="Forms" />
</system.web>
<system.net>
<mailSettings>
<smtp deliveryMethod="Network">
<network
defaultCredentials="False"
host="MyServerURL"
password="MyPassword"
port="25"
userName="MyUserName"
from="admin@mcwtech.com"/>
</smtp>
</mailSettings>
</system.net>
</configuration>
Obviously, you should replace MyServerURL, MyPassword, and MyUserName with the appropriate values for your site.
Once I made these changes to my web.config, I was able to place a PasswordRecovery control on a page, and all the plumbing worked fine. It's just the Website Configuration tool that doesn't work. (If it does work for you, please let me know.)