done this coding:
try
{
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.EnableSsl = true;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential("rahil.r10@gmail.com", "password");
MailMessage msg = new MailMessage();
msg.To.Add(txtfromid.Text);
msg.From = new MailAddress("rahil.r10@gmail.com");
msg.Subject = txtsubject.Text;
msg.Body = txtcomt.Text;
client.Send(msg);
Response.Write("maan ja yaar");
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
but i m getting error this:
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
plz say me how to solve this error
<form method="post" action=" ...
Go to the complete details ...