Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hallo,

I want to send a mail thru asp. If I follow some tutorials like this:

http://forums.asp.net/t/971802.aspx/1/10[^]


I get the error message:

530 5.7.0 Must issue a STARTTLS command first

Does anyone know what this means? What do I have to do to make the program run? For testing purposes I created a hotmail address which I'm using.

Thanks
Posted

1 solution

System.Net.Mail.MailMessage obj = new System.Net.Mail.MailMessage();
SmtpClient serverobj = new SmtpClient();
serverobj.Credentials = new NetworkCredential("anilmeets4u@gmail.com", "yourpassword");
serverobj.Port = 587;
serverobj.Host = "smtp.gmail.com";
serverobj.EnableSsl = false;
obj = new System.Net.Mail.MailMessage();
obj.From = new MailAddress("anilmeets4u@gmail.com", "AgileLearning.com", System.Text.Encoding.UTF8);

obj.To.Add(ds.Tables[0].Rows[i]["strEmail"].ToString());
obj.Priority = System.Net.Mail.MailPriority.High;
obj.Subject = "Regarding TechnicalProblem";
string date = DateTime.Now.ToString();
obj.Body = "Your Technical Problem will be Rectified Within 24Hours";
serverobj.Send(obj);
Try this

Regards,

Anilkumar.D
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900