Click here to Skip to main content
15,943,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to send a mail.

C#
System.Net.Mail.MailMessage Msg = new System.Net.Mail.MailMessage();
MailAddress fromMail = new MailAddress("xxx@gmail.com");

Msg.Subject = subject;
Msg.Body = myString.ToString();
Msg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "xxx-outlook.com";
smtp.Port = 587;
smtp.UseDefaultCredentials = false;
smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
smtp.Credentials = new NetworkCredential(user, pwd);
smtp.EnableSsl = false;
smtp.Timeout = 20000;
smtp.Send(Msg);


Please help. Thanks in advance
Posted
Updated 17-Dec-17 16:19pm

 
Share this answer
 
Comments
srmohanr 7-Jan-14 4:33am    
I could not get clear answer from that link. Please help
C#
smtp.EnableSsl = true;
 
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