How can an email be attached, as an MSG file, to an outgoing email in CRM 2011?
I have created an html attachment of the email which is OK, but the html attachment has to be viewed in the browser; the preview in Outlook does not display the images.
The problem that I have is that the ActivityMimeAttachment Entity in CRM requires the body to be a Base64 string, which is ok if it is an html string to be the attachment:
// 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;
How can I use a MSG file created from System.Net.Mail.MailMessage
as an attachment or how can I convert a System.Net.Mail.MailMessage
email to a Base64String?