public EmailNotificationResponsecs SendEmail(Common.Notification.SendMailRequest emailModel) { EmailNotificationResponsecs outcome = new EmailNotificationResponsecs(); try { var client = new SmtpClient(smtpAddress, 587) { Credentials = new NetworkCredential(sendFromEmail, sendFromPassword), EnableSsl = true }; MailMessage mail = new MailMessage(sendFromEmail, emailModel.replyto, emailModel.subject, emailModel.body); mail.IsBodyHtml = true; if (!string.IsNullOrWhiteSpace(emailModel.cc)) { mail.CC.Add(emailModel.cc); } client.Send(mail); outcome.Message = "Email has been successfully sent!!"; outcome.CompletedWithSuccess = true; return(outcome); } catch (Exception ex) { outcome.Message = "There is an issue in sending the Email, Please contact administrator!! : " + ex.Message; outcome.CompletedWithSuccess = false; return(outcome); } }
public EmailNotificationResponsecs SendEmail(Common.Notification.SendMailRequest emailModel) { EmailNotificationResponsecs emailDeliveryResult = _emailNotificationProxy.SendEmail(emailModel); return(emailDeliveryResult); }