anyway i was trying to use gmail as my smtp service on the server configuration. i need it to retrieve the password in case a user forgets his password.
problem is im getting this 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. 23sm155884pxi.5
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Net.Mail.SmtpException: 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. 23sm155884pxi.5
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
Stack Trace:
______________________________________________________________________________
i have no clue how to fix this error. please help! thanks in advance.

Kirtan PatelRank #292 · 8.6K reputationPosted Dec 4, 2009, 8:34 AM EST
and In Code you have to Write Like Below to send mail;
using System.Net.Mail;
protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
{
SmtpClient client = new SmtpClient();
client.EnableSsl = true;
client.Send(e.Message);
}
Hiren SoniRank #694 · 3.5K reputationPosted Dec 4, 2009, 7:55 AM EST
Mark Uy130 reputationPosted Dec 4, 2009, 8:00 AM EST
Hiren SoniRank #694 · 3.5K reputationPosted Dec 4, 2009, 8:03 AM EST
Hiren SoniRank #694 · 3.5K reputationPosted Dec 4, 2009, 8:03 AM EST
Mark Uy130 reputationPosted Dec 4, 2009, 8:08 AM EST
the smtp settings inside the website administration tools asks only these options:
Choose this option if your e-mail server requires you to explicitly pass a user name and password when sending an e-mail message.
Choose this option if your e-mail server is on a local area network and you connect to it using windows credentials.
so i have no idea how to add a new set of code in there.
Mark Uy130 reputationPosted Dec 4, 2009, 8:48 AM EST
this is on the password recovery control.
is this the correct event to put the code you wrote?
protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
{
}
Kirtan PatelRank #292 · 8.6K reputationPosted Dec 4, 2009, 8:51 AM EST
Mark Uy130 reputationPosted Dec 4, 2009, 8:51 AM EST
alright.
i have another. i want my website to automatically send an email once it reaches a specific date. it doesnt need to be a part of a webform or webpage.
what should i do??
Kirtan PatelRank #292 · 8.6K reputationPosted Dec 4, 2009, 8:59 AM EST
Mark Uy130 reputationPosted Dec 4, 2009, 9:02 AM EST
Mark Uy130 reputationPosted Dec 4, 2009, 2:33 PM EST
how do i modify the codes now that i am using the global.asax? heres what i come up with.
i want a datareader to check the date on a table and compare it to the current date today. now if it has rows that matches. i want to send an email to notify an email address that a unit needs servicing.
void Application_Start(object sender, EventArgs e) { // Code that runs on application startup // Warranty Automation Application SqlConnection conGlobal = new SqlConnection (@"Data Source=.\SQLEXPRESS;AttachDbFileName=|DataDirectory|\TRANE.mdf;Integrated Security=True;User Instance=True"); conGlobal.Open(); string selService; selService = "Select * From ServiceLink WHERE DatetimeSched='" + DateTime.Now.ToShortDateString() + "'"; SqlCommand globalCom = new SqlCommand(selService, conGlobal); SqlDataReader globalReader = globalCom.ExecuteReader(); if (globalReader.HasRows) { SmtpClient client = new SmtpClient(); client.EnableSsl = true; client.Send(" There are products that needs servicing. Please view ServiceLiink Record ");anybody else who can help as well?