Dear sir,
Kindly help me. I have a contact us page asp.net there have 4 textboxes and a submit button. when user submit the button i need to send the textbox datas to my gmail account. Can you help me. i got following error.
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
I used following code but its not work.
MailMessage msg = new MailMessage();
msg.From = new MailAddress("aspectind@gmail.com");
msg.To.Add("aspectind@gmail.com");
msg.Subject = txtsubject.Text;
msg.Body="<b>Sender name:</b>"+txtname.Text+"<br/>"
+ "<b>Sender E-mail:</b>" + txtemail.Text + "<br/>"
+ "<b>Comments:</b>" + txtcomments.Text;
msg.IsBodyHtml = true;
SmtpClient smtpclient = new SmtpClient("smtp.gmail.com",587);
smtpclient.EnableSsl = true;
smtpclient.Credentials = new System.Net.NetworkCredential("aspectind@gmail.com","15171819");
smtpclient.Send(msg);
Label5.Text = "Thank you for contacting us";
Thanks & Regards
Rajeesh
aspectind@gmail.com