Hi Albert,
Thanks for your request. Could you please attach your document here for testing? We will check the issue and provide you more information.
Best regards,
Hi Albert,
Thank you for additional information. But on my side I can successfully open MHTML document from stream using Aspose.Words. However, Aspose.Words throws an exception when attempt to save the document to PDF. I logged this problem in our defect database. We will let you know once it is resolved.
Best regards,
Thank you, could you please let me know whether is there a way to save as HTML instead of PDF? Because, either PDF or HTML output works good for me.
Hi
Thanks for your request. Conversion to HTML works fine on my side. Here is code I used for testing:
Aspose.Network.Mail.MailMessage msg = Aspose.Network.Mail.MailMessage.Load(@"Test001\Sample.msg", Aspose.Network.Mail.MessageFormat.Msg);
MemoryStream msgStream = new MemoryStream();
msg.Save(msgStream, Aspose.Network.Mail.MailMessageSaveType.MHtmlFromat);
msgStream.Position = 0;
Document msgDocument = new Document(msgStream);
msgDocument.Save(@"Test001\out.html");
Best regards,
I used the same code that you have given and I’m getting error in below line of code
Hi
Thanks for your request. I cannot reproduce this problem on my side. I use Aspose.Words 10.5.0 and Aspose.Network 6.5.0 for testing. Please try using the latest version of both products.
Best regards,
Hello
Thank you for additional information. I cannot reproduce the problem on my side. I have sent the HTML document produced by the following code to your e-mail:
Aspose.Network.Mail.MailMessage msg = Aspose.Network.Mail.MailMessage.Load(@"C:\Temp\Sample.msg", Aspose.Network.Mail.MessageFormat.Msg);
MemoryStream msgStream = new MemoryStream();
msg.Save(msgStream, Aspose.Network.Mail.MailMessageSaveType.MHtmlFromat);
msgStream.Position = 0;
Document msgDocument = new Document(msgStream);
msgDocument.Save(@"C:\Temp\out.html");
Best regards,
Thank you! Yes, it worked for me as well, but i don’t want the header part. I just want the body of the e-Mail. I just want the HtmlBody without having the below mentioned Header details.
From: Albert Milton
Sent: 13.10.2011 19:02:27
To: Albert Milton
Subject: Sample(Aspose.Network Evaluation)
Attachments: License.txt
Hi
Thank you for additional information. I suppose the problem might occur because when you simply get body HTML from the message, paths to images are not valid. So Aspose.Words cannot access them. Please try to check the body HTML and see whether paths to images are valid and accessible.
Best regards,
Hi
<o:p> </o:p>
Aspose.Network.Mail.MailMessage msg = Aspose.Network.Mail.MailMessage.Load(@“C:\Temp\Sample.msg”, Aspose.Network.Mail.MessageFormat.Msg);<o:p></o:p>
MemoryStream msgStream = new MemoryStream();<o:p></o:p>
msg.Save(msgStream, Aspose.Network.Mail.MailMessageSaveType.MHtmlFromat);<o:p></o:p>
msgStream.Position = 0;<o:p></o:p>
<o:p> </o:p>
Document msgDocument = new Document(msgStream);<o:p></o:p>
msgDocument.Save(@“C:\Temp\out.html”);
Hi
Thank you for additional information. Of course images will be there when you save to MHTML first. Because in this case, images are stored inside the MHTML file. However, when you simply get HtmlBody of the message, Aspose.Network does not save the images outside. The links to images will be the same:
<img border="0" width="600" height="200" id="Picture_x0020_6" src="cid:image001.jpg@01CC8997.9878C3A0" alt="Description: http://image.exct.net/lib/ff011672706104/m/1/2012MedSeason_Quality.jpg">
As you can see it refers to the internal resource inside MSG or MHTML file. OF course this image will not be accessible when you simply use HTML string.
Try this code and you will notice the same:
Aspose.Network.Mail.MailMessage msg = Aspose.Network.Mail.MailMessage.Load(@"Test001\Sample.msg", Aspose.Network.Mail.MessageFormat.Msg);
using (FileStream fs = File.Create(@"Test001\out.html"))
{
using (StreamWriter writer = new StreamWriter(fs))
{
writer.Write(msg.HtmlBody);
}
}
Best regards,
The issues you have found earlier (filed as WORDSNET-5371) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.