contact form email question http://forums.asp.net/t/1775640.aspx/1?contact+form+email+question+Thu, 01 Mar 2012 15:56:33 -050017756404859268http://forums.asp.net/p/1775640/4859268.aspx/1?contact+form+email+question+contact form email question <p>i have created a contact me form .&nbsp;&nbsp; i have two questions</p> <p>&nbsp;</p> <p>1. when the user hits submit how do i ge the page to refresh without displaying the data they had entered .&nbsp; &quot;also i may add in the last line of code it shows the user the email was sent&quot;&nbsp; would this still display if i rerech the page withought the data....&nbsp;</p> <p>2. with the code i have how do i send a reply to the user saying thank you your request has been sent someone willl respond shortly.......&nbsp; something on those lines...</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>thanks in advance for your help.</p> 2012-03-01T15:30:05-05:004859277http://forums.asp.net/p/1775640/4859277.aspx/1?Re+contact+form+email+question+Re: contact form email question <p>clearing the form is a simple mater of doing</p> <p>txtUserName.text = string.empty;&nbsp;</p> <p>in your processing function for all fields to clear.</p> <p>You can have a function to send the email and have it retrun a boolean value with pass fail to determine to show a success message.</p> <p>Take a look at this for sending email</p> <p><a href="http://forums.asp.net/t/971802.aspx">http://forums.asp.net/t/971802.aspx</a></p> 2012-03-01T15:35:45-05:004859283http://forums.asp.net/p/1775640/4859283.aspx/1?Re+contact+form+email+question+Re: contact form email question <p>this is what you want -&nbsp;<a href="http://www.intstrings.com/ramivemula/asp-net/ajax-html-editor-based-contact-form-inside-updatepanel-along-with-updateprogress/">http://www.intstrings.com/ramivemula/asp-net/ajax-html-editor-based-contact-form-inside-updatepanel-along-with-updateprogress/</a>&nbsp;</p> <p>thanks,</p> 2012-03-01T15:39:44-05:004859285http://forums.asp.net/p/1775640/4859285.aspx/1?Re+contact+form+email+question+Re: contact form email question <p>for #1 you on your button click, after the submission if finished just set all textbox values equal to &quot;&quot; That will make them all blank, then after all that happens show a div that has &quot;Email Sent&quot; that is initially hidden with divname.style(&quot;display&quot;) = &quot;block&quot; or do label.Text = &quot;Email Sent&quot; if you want to use a blank label.</p> <p></p> <p>#2 You can send an email in code behind with this (VB.NET)</p> <pre class="prettyprint">'Send Email confirming Receipt. Dim objMM As New MailMessage() 'Set the properties - send the email to the person who filled out the feedback form. objMM.To.Add(New MailAddress(SenderEmail)) objMM.Bcc.Add(New MailAddress(&quot;aa@bb.com&quot;)) objMM.From = New MailAddress(&quot;aa@bb.com&quot;) 'Send the email in text format objMM.IsBodyHtml = True 'Set the subject objMM.Subject = &quot;Email Subject&quot; 'Set the body objMM.Body = &quot;Thank you for submitting. This email is to confirm that everything has been received&quot; objMM.Priority = MailPriority.Normal 'Specify to use the default Smtp Server Dim mSmtpClient As New SmtpClient mSmtpClient.Host = &quot;someip&quot; mSmtpClient.Send(objMM)</pre> 2012-03-01T15:40:15-05:004859300http://forums.asp.net/p/1775640/4859300.aspx/1?Re+contact+form+email+question+Re: contact form email question <p>TY Very much!!!!&nbsp;&nbsp; can you send that code in c#?</p> 2012-03-01T15:51:53-05:004859305http://forums.asp.net/p/1775640/4859305.aspx/1?Re+contact+form+email+question+Re: contact form email question <p>I dont have it in C# but using a converter it came up with this (May not be 100% accurate)</p> <p></p> <pre class="prettyprint">MailMessage objMM = new MailMessage(); //Set the properties - send the email to the person who filled out the feedback form. objMM.To.Add(new MailAddress(SenderEmail)); objMM.Bcc.Add(new MailAddress(&quot;aa@bb.com&quot;)); objMM.From = new MailAddress(&quot;aa@bb.com&quot;); //Send the email in text format objMM.IsBodyHtml = true; //Set the subject objMM.Subject = &quot;Email Subject&quot;; //Set the body objMM.Body = &quot;Thank you for submitting. This email is to confirm that everything has been received&quot;; objMM.Priority = MailPriority.Normal; //Specify to use the default Smtp Server SmtpClient mSmtpClient = new SmtpClient(); mSmtpClient.Host = &quot;someip&quot;; mSmtpClient.Send(objMM);</pre> 2012-03-01T15:53:50-05:004859310http://forums.asp.net/p/1775640/4859310.aspx/1?Re+contact+form+email+question+Re: contact form email question <p>ty all this is all very helpful</p> 2012-03-01T15:56:33-05:00