コード例 #1
0
        public IEmail CreateEmail(
            IEmailAddressProvider recipient,
            string fromEmailAddress,
            string subject,
            [MultiLine(NumberOfLines = 5)] string body,
            [Optionally] IDocumentHolder associateAsDocumentWith)
        {
            var msg   = new MailMessage(fromEmailAddress, recipient.DefaultEmailAddress().ToString(), subject, body);
            var email = EmailService.SendAndSaveEmail(msg);

            if (associateAsDocumentWith != null)
            {
                DocumentService.AddExternalDocument(associateAsDocumentWith, email);
            }
            return(email);
        }