/// <summary>
        /// Converts an instance of Aspose.Email.Mail.MailMessage to Aspose.Words.Document class
        /// </summary>
        /// <param name="message"></param>
        /// <param name="includeAttachments"></param>
        /// <returns></returns>
        public static Aspose.Words.Document MailMessageToDocumentConverter(Aspose.Email.Mail.MailMessage message, bool includeAttachments)
        {
            MemoryStream msgStream = new MemoryStream();

            message.Save(msgStream, MailMessageSaveType.MHtmlFormat);
            msgStream.Position = 0;

            // Load the MHTML stream using Aspose.Words for .NET
            Document msgDocument = new Document(msgStream);

            return(msgDocument);
        }
Esempio n. 2
0
        private static void MailToImage()
        {
            Aspose.Email.Mail.MailMessage msg = Aspose.Email.Mail.MailMessage.Load(@"C:\test.msg", MessageFormat.Msg);

            MemoryStream msgStream = new MemoryStream();

            msg.Save(msgStream, MailMessageSaveType.MHtmlFromat);
            msgStream.Position = 0;

            Document msgDocument = new Document(msgStream);

            msgDocument.Save(@"C:\Outlook-Aspose.jpeg", Aspose.Words.SaveFormat.Jpeg);
        }