If you have a contact form that sends messages to email accounts, there is some extra configuration that you have to make so that it can work. In this article I will give give you a step-by-step guide on how to configure mail settings in Web.Config:

1. Open your ASP.Net project.

2. Then open the Web.Config file of your project:


3. We are going to use three tag elements:

The <system.net> element which contains the specifics on how the .net framework connect to the network.

The <mailSettings> element lets you configure mail sending options.

The <smtp> element lets you configure the delivery method and the email address.

4. Look for the <configuration> section:


5. Add this code in the web.config file:


<smtp from=”emailaccount@exampleemail.com”>
<network host=”smtp.exampleemail.com”


6. Save your changes and that’s it! The email has been configured!

This concludes Configure Mail Settings in Web.Config 🙂

Leave a Reply