Saturday, June 6, 2009

Email configuration for .net

Before you can send email through asp.net application, you need to do some configuration in web.config

Here is the things that you need to include in web.config


<system.web>
</system.web>

<system.net>
<mailSettings>
<smtp from="foo@foo.com">
<network host="127.0.0.1" port="25"/>
</smtp>
</mailSettings>
</system.net>




You need to change <smtp from="foo@foo.com"> to any value you like. It will be used as a default "FROM:" when you send email.

While for the host, you need to ask your administrator what is the smtp address to send emails

On the next post, I will show you how to send emails through .net application.

No comments:

Post a Comment