Mega Code Archive

 
Categories / ASP.Net Tutorial / Development
 

The MailDefinition class uses the email server configured by the smtp element in the web configuration file

File: Web.Config <configuration>   <system.net>     <mailSettings>       <smtp deliveryMethod="PickupDirectoryFromIis"/>     </mailSettings>   </system.net>   <system.web>     <authentication mode="Forms" />   </system.web> </configuration> To connect to a mail server located on another machine File: Web.Config <configuration>   <system.net>     <mailSettings>       <smtp>         <network             host="mail.YourServer.com"             userName="admin"             password="secret" />       </smtp>     </mailSettings>   </system.net>   <system.web>     <authentication mode="Forms" />   </system.web> </configuration>