Ejemplo n.º 1
0
        private MapiMessage BuildMapiMessage(Email email, Checks checks)
        {
            //Throws error if To is empty either 2 or 25
            if (!string.IsNullOrWhiteSpace(email.To))
            {
                AddRecipientTo(email.To);
            }

            if (!string.IsNullOrWhiteSpace(email.Attachment))
            {
                AddAttachment(email.Attachment);
            }

            var message = new MapiMessage
            {
                subject = email.Subject,
                //Add CRLF in an attempt to move cursor placement in open email message
                noteText = checks.AddCrlf ? $"{email.Body} {Environment.NewLine}" : email.Body
            };

            message.recipients = MapiRecipient.GetRecipients(out message.recipientCount);
            message.files      = MapiAttachment.GetAttachments(out message.fileCount);

            return(message);
        }
Ejemplo n.º 2
0
 //Usability: Outlook and Thunderbird
 //Recipients: Multiple (sep: ;)
 //Attachments: Multiple (call AddAttachment for each file)
 //Signature: In app
 //Send Direct: Yes
 public bool AddRecipientTo(string email)
 {
     return(MapiRecipient.AddRecipient(email, RecipientType.To));
 }