Hi,
I’m trying to convert an email to a word document, and I’m encountering the problem that the background of the email is not included in the document.
I’m using the following code:
// the MailMessage class is part of Aspose.Network
private Document GetDocumentFromEmail(MailMessage mailMessage)
{
// create the Word Document
Document document = new Document();
// create the Word DocumentBuilder
DocumentBuilder documentBuilder = new DocumentBuilder(document);
// set the papersize to A4
documentBuilder.PageSetup.PaperSize = PaperSize.A4;
if (mailMessage.IsBodyHtml && !string.IsNullOrEmpty(mailMessage.HtmlBody))
{
documentBuilder.InsertHtml(mailMessage.HtmlBody);
}
else
{
documentBuilder.Write(mailMessage.TextBody);
}
return document;
}
Can someone please tell me what I’m doing wrong?
Attached is a test email file.
Sincerely,
Geert-Jan Smulders