public ActionResult OpenEmptyClient(IList <string> files, string signature)
        {
            var mailInfo = new MailInfo {
                Attachments = files, Body = signature
            };

            return(ProcessMailInfo(mailInfo));
        }
        private Email CreateEmail(MailInfo mailInfo)
        {
            var mail = new Email
            {
                Html    = mailInfo.IsHtml,
                Subject = mailInfo.Subject,
                Body    = mailInfo.Body,
            };

            mail.Recipients.AddTo(mailInfo.Recipients);
            mail.Recipients.AddCc(mailInfo.RecipientsCc);
            mail.Recipients.AddBcc(mailInfo.RecipientsBcc);

            AddOutputFilesAsAttachmentsForEmailClientAction(mail, mailInfo.Attachments);

            return(mail);
        }
Exemple #3
0
        public MailInfo CreateMailInfo(Job job, IMailActionSettings mailSettings)
        {
            _logger.Trace("Create MailInfo for " + mailSettings.GetType().Name.Replace("Settings", " Action."));

            var mailInfo = new MailInfo
            {
                Subject       = mailSettings.Subject,
                Body          = BuildBody(mailSettings),
                Recipients    = mailSettings.Recipients.Replace(';', ','),
                RecipientsCc  = mailSettings.RecipientsCc.Replace(';', ','),
                RecipientsBcc = mailSettings.RecipientsBcc.Replace(';', ','),
                IsHtml        = mailSettings.Html,

                Attachments = GetFileAttachmentList(job, mailSettings)
            };

            return(mailInfo);
        }
        private Email CreateEmail(MailInfo mailInfo)
        {
            var mail = new Email
            {
                Html    = mailInfo.IsHtml,
                Subject = mailInfo.Subject,
                Body    = mailInfo.Body,
            };

            mail.Recipients.AddTo(mailInfo.Recipients);
            mail.Recipients.AddCc(mailInfo.RecipientsCc);
            mail.Recipients.AddBcc(mailInfo.RecipientsBcc);

            foreach (var file in mailInfo.Attachments)
            {
                var attachment = new Attachment(file);
                mail.Attachments.Add(attachment);
                _logger.Debug("Added mail attachment " + file);
            }

            return(mail);
        }