0

hi i am using asp.net (VS 2005), the password recovery control gives me the foll error..

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. b4sm1464356tic.36

i have a gmail account, the details of which have been entered in the asp.net config file with the help of the browser interface tool ( applications > smtp settings ). the properties of the control has also been set ( mail definition ).

Please help

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by bharatshivram
0

Solved it myself

protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
{
MailMessage message = e.Message;

try
{
SmtpClient smtp = new SmtpClient();
smtp.EnableSsl = true;
smtp.Send(message);
}
catch (Exception ex)
{
throw new Exception("There was a problem sending the email.", ex);
}

e.Cancel = true;
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.