コード例 #1
0
ファイル: EPiMailEngine.cs プロジェクト: bjarte/Newsletter
        protected MailInformation GetMailInformation(MailSenderBase sender, ContentReference pageRef, string from, string subject)
        {
            // Get content to send
            MailInformation mailInfo = sender.GetMailInformation(pageRef as PageReference);

            if (!string.IsNullOrEmpty(subject))
            {
                mailInfo.Subject = subject; // Can be something other than the pagename
            }
            mailInfo.From = from;
            return(mailInfo);
        }
コード例 #2
0
ファイル: EPiMailEngine.cs プロジェクト: bjarte/Newsletter
        /// <summary>
        /// Send mail to mailreceivers
        /// </summary>
        /// <param name="subject">subject for mail</param>
        /// <param name="pageRef">reference to mailpage</param>
        /// <param name="from">from-address for mail</param>
        /// <param name="onlyTestDontSendMail">No mails are sent, generating report for user</param>
        /// <param name="job">The job to send as newsletter</param>
        /// <returns></returns>
        public SendMailLog SendNewsletter(string subject, string from, ContentReference pageRef, JobWorkItems workItems, bool onlyTestDontSendMail)
        {
            // Construct correct sender object based on config setting
            MailSenderBase sender = GetMailSender();

            // Construct mail object with default values and content
            MailInformation mailInfo = GetMailInformation(sender, pageRef, from, subject);

            // Send it
            SendMailLog log;

            log = sender.SendEmail(mailInfo, workItems, onlyTestDontSendMail);

            // Add additional information to the log
            log.Subject = subject;

            return(log);
        }
コード例 #3
0
ファイル: EPiMailEngine.cs プロジェクト: tsolbjor/Newsletter
 protected MailInformation GetMailInformation(MailSenderBase sender, ContentReference pageRef, string from, string subject)
 {
     // Get content to send
     MailInformation mailInfo = sender.GetMailInformation(pageRef as PageReference);
     if (!string.IsNullOrEmpty(subject))
         mailInfo.Subject = subject; // Can be something other than the pagename
     mailInfo.From = from;
     return mailInfo;
 }