The following is my code for sending email in contact us page of my website.
VB.NET
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
msg.From = new MailAddress(emailid.Text);
msg.To.Add("[email protected]");
msg.Subject = subject.Text;
msg.Body = txtBody.Text;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.Credentials = new System.Net.NetworkCredential("[email protected]", "mygmailpassword");
smtp.EnableSsl = true;
smtp.Send(msg);
Satyapriya NayakRank #47 · 31.5K reputationPosted Mar 23, 2013, 3:54 AM EDT
Rasadul Alam Rashed46 reputationPosted Mar 27, 2013, 9:50 PM EDT
for more details with source code: http://cybarlab.com/send-e-mail-using-c-sharp
Thanks n regard