Himanshu Manjarawala Sr. Software Engineer@AutomationAnywhere http://fieredotnet.wordpress.com/
raj
[WebMethod] public bool SendMail(string fromAddress, string toAddress, string subject, string body) { try { MailMessage msg = new MailMessage(); msg.From = new MailAddress(fromAddress); msg.To.Add(new MailAddress(toAddress)); msg.Subject = subject; msg.Body = body; msg.IsBodyHtml = true; SmtpClient smtp = new SmtpClient("127.0.0.1"); //replace with your smtp client smtp.Send(msg); return true; } catch(Exception exp) { return false; } }
Thanks, Sanjay
Login to post response