public ActionResult DocumentSendConfirm(MailSenderModel mailSenderModel) { if (mailSenderModel != null) { try { Document baseDocument = db.Documents.Find(mailSenderModel.Id); _notificationManager.TrySendNotification(EventType.CommentForPriceApp, ObjectType.PriceProject, baseDocument); DocumentManager.CreateIncomingDocs(baseDocument); List <string> listEmail = db.Units.Where(o => o.Type == 0).Select(o => o.Email).ToList(); MailSender mailSender = new MailSender(); mailSender.SendMail(mailSenderModel.Email, mailSenderModel.Title, mailSenderModel.Text, mailSenderModel.Id.ToString(), mailSenderModel.Files, baseDocument.Id, listEmail); return(Content(bool.TrueString)); } catch (Exception ex) { if (ex.InnerException != null) { return(Content(ex.Message + ex.InnerException.Message)); } else { return(Content(ex.Message)); } } } return(Content(bool.FalseString)); }
public ActionResult DocumentSend(Guid id) { Document baseDocument = db.Documents.Find(id); MailSenderModel action = new MailSenderModel() { Id = baseDocument.Id, Title = "Документ № " + baseDocument.DisplayName, DocumenetNumber = baseDocument.Number, Email = baseDocument.ApplicantEmail, DocumenetDate = baseDocument.DocumentDate.HasValue ? baseDocument.DocumentDate.Value.ToString("dd.MM.yyyy HH:mm") : string.Empty }; //MailSender mailSender = new MailSender(); //mailSender.SendMail("*****@*****.**", "тутвсе просто", "все очень просто"); return(PartialView(action)); }