public static string SendEmail(string receivermailid, string subject, string body) { MailMessage MyMailMessage = new MailMessage("xyz@live.com", receivermailid, subject, body); MyMailMessage.IsBodyHtml = true; NetworkCredential mailAuthentication = new NetworkCredential("xyz@live.com", "xxxx"); SmtpClient mailclient = new SmtpClient("smtp.live.com", 25); mailclient.EnableSsl = true; mailclient.UseDefaultCredentials = false; mailclient.Credentials = mailAuthentication; try { mailclient.Send(MyMailMessage); return "Sent successfully"; } catch (SmtpException ex) { return ex.Message; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)