Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 21, 2013 05:39 AM by ramiramilu
Feb 20, 2013 11:55 PM|LINK
I am creating a contact us form using VB for a website but don't know how to specify SMTP setting(user name, password etc...) in webconfig file and using those setting in Contact us form.
Kindly explain with some sample code or example.
Feb 21, 2013 12:32 AM|LINK
In your web.config file, add an element called <appSettings> between <configuration> and <system.web>, inside the appSettings element, use the <add/> element to add variables:
<add key="MyKey" value="SMTPValue"/>
You can access these values by the System.Configuration.ConfigurationSettings class' static AppSettings property. Like this:
public class MyPage : System.Web.Page
public void Page_OnLoad()
Feb 21, 2013 04:04 AM|LINK
Thanks for prompt reply.
The code you wrote is in C# where as I am using VB so, please send me the VB code with an Example.
Feb 21, 2013 04:46 AM|LINK
Feb 21, 2013 05:39 AM|LINK
check this tutorial - http://www.intstrings.com/ramivemula/asp-net/ajax-html-editor-based-contact-form-inside-updatepanel-along-with-updateprogress/