Need Help ASP.net problem!

Hi to all,

I have a problem regarding for my email contact form. I don’t know where the problem is as I checked all my codes as well as my smtp settings for this email contact form. But the errors still exist on my web.config. Any correction, suggestion or a simple email form scripts for my codes guys will be a great help. Please help me. Thanks to all in advance. below are my codes.

Error: Unrecognized element ‘To’. (C:\web files\web.config line 11)

I’m using IIS as my web server.

Below is my web.config setting. I edited the email info and pass for confidentiality and considering that’s work fine. The Red text/line was the error indicating on line 11.

<?xml version=“1.0”?>
<configuration>
<configSections> <section name=“EmailConfig”
type=“WebWorks.Common.Configuration.EmailConfig,
WebWorks.Common.Configuration”/>
</configSections>

&lt;EmailConfig&gt;
	&lt;Notifications&gt;
		&lt;Notification Name="Request" Subject="Book Online       
                      Request" IsBodyHtml="true" IndividualMail="true" 
                      Template="~/Templates/Request.htm"/&gt; 
			 
               &lt;To&gt; 
                       [COLOR="Red"]&lt;Email Name="admin" Address="myname@gmail.com"/&gt;[/COLOR]
                  &lt;/To&gt;
	&lt;/Notifications&gt;		

&lt;/EmailConfig&gt;

<system.net>
<mailSettings>
<smtp from="myname@gmail.com">
<network host=“smtp.gmail.com” port=“465” enableSsl=“true”
userName="myname@gmail.com"
password=“mypassword”/>
</smtp>
</mailSettings>
</system.net>

&lt;system.web&gt;
	&lt;compilation debug="false"/&gt;
&lt;/system.web&gt;

&lt;system.webServer&gt;
	&lt;modules runAllManagedModulesForAllRequests="true"/&gt;
&lt;/system.webServer&gt;

</configuration>

You can put them in app settings and can fetch them in code.

Hi Williamjerry,

Thanks for the info but can you give me an example on how can I put them in app? sorry for being confused about this. Thanks again in advance.