3

如何将电子邮件作为 MSG 文件附加到 CRM 2011 中的外发电子邮件?

我已经创建了电子邮件的 html 附件,可以,但是必须在浏览器中查看 html 附件;Outlook 中的预览不显示图像。

我遇到的问题是 CRM 中的 ActivityMimeAttachment 实体要求正文是 Base64 字符串,如果它是作为附件的 html 字符串,则可以:

        // UnicodeEncoding had to be used as there were problems with 
        // special char in ASCII
        var bodyArray = System.Text.UnicodeEncoding.Unicode.GetBytes(body);
        body = System.Convert.ToBase64String(bodyArray);
        return body;

如何将创建的 MSG 文件System.Net.Mail.MailMessage用作附件,或者如何将System.Net.Mail.MailMessage电子邮件转换为 Base64String?

4

0 回答 0