How to send Email confirmation to user on click of submit button?

Posted by Iluvdotnetfunda under C# on 4/19/2012 | Points: 10 | Views : 2020 | Status : [Member] | Replies : 5
Hello Friends,

Hope you are doing well.
Here is my Email Field and Button .on click of the submit button how to send user a Email.

<asp:TextBox runat="server" ID="EmailID" MaxLength="30" ValidationGroup="EmailReg" />
<asp:RequiredFieldValidator ID="req14" ErrorMessage="*" ForeColor="Red" runat="server"
ValidationGroup="EmailReg" ControlToValidate="EmailID" Display="Dynamic"></asp:RequiredFieldValidator>


 <asp:Button ID="btn1" runat="server" Text="Submit" />


Anyone please help me.

Thanks
iluvdotnetfunda




Responses

Posted by: GSM_GSV on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
Refer the below site...

http://forums.asp.net/t/1516921.aspx/1

---------------------------------------
Live the life you've dreamed

Regards
MADHU

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sunny4989 on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
Hello

Can you please be more specific


------------------------------------------------
Learn throughout life

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dotnetrajanikanth on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down

Dim mail As New MailMessage
mail.From = New MailAddress(Me.TxtMailFrom.Text)
mail.To.Add(Me.TxtMailTo.Text)
mail.Subject = Me.TxtSubject.Text
mail.Body = Me.TxtBody.Text
Dim smtp As New SmtpClient
smtp.Host = <"Host Ip Address">
smtp.Port = <your port number>
smtp.Send(mail)


Put this code in button click event. you can change the textboxes with strings that you want.

this will work. i have tested it.

____________
www.flickr.com/photos/psdesigner/

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sunny4989 on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
It's not working fine some exception is coming ...

I tried now

------------------------------------------------
Learn throughout life

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Iluvdotnetfunda on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Friends,

Thanks for your help , it was cleared.

iluvdotnetfunda

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response