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:
<system.net> <mailSettings> <smtp from="firstname.lastname@example.org"> <network host="smtp.exampleemail.com" port="587" userName="email@example.com" password="emailpassword" enablessl="false"/> </smtp> </mailSettings> </system.net>
6. Save your changes and that’s it! The email has been configured!
This concludes Configure Mail Settings in Web.Config