We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

MailMessage creation - message read in PlainText format and not in HTML format

Hello,

I create a java class to compose an email from input Text. Generally users copy/paste text from Word or from Outlook.

To create my Message I use this code:

MailMessage message = MailMessage.load(
new ByteArrayInputStream(htmlbody.getBytes()),
new HtmlLoadOptions());

Often the styles (font color, font-size, text-formating) are respected but sometime my message is read as a Plain Text message and styles are not there.

Is there any idea you have about my problem or some best-practice I can use?

Best Regards,

Riccardo

@GreenRic,

Thank you for contacting Aspose support team.

Could you please share some file containing such a stream which can be used to reproduce the scenario here? It will help us to observe the problem and provide assistance accordingly.

HEllo @kashif.iqbal thanks for your help.
With a big delay I’ve attached you the code that I use to reproduce the problem. method_exemple.zip (4.0 KB)

Let me know if I can give you others elements.

Best Regards,

Riccardo

@GreenRic,

We ran your sample code with the latest version of the API and the output generated is fine as you can see in attached file. Could you please share your output file or a screenshot of the output with us? Please try it with latest version of the API in case you are not doing it already. test.zip (8.7 KB)

Hello @kashif.iqbal,

thanks a lot.
I downloaded the last version and It works !!!
Unfortunatelly I have a regression. The solution that you propose me in this case Embedding image in oft template mail

it don’t work now!

If you need an example code, let me know.
If I have to close this thread and open another one, I will do.

Thanks in advanced,

Riccardo

@GreenRic,

It will be better if you create a new thread and attach any input source files and sample code with it for our analysis. We’ll look into it for assisting you further.

is it possible to create a pst file from java that is recognizable by the outlook?

@wolfvain,

I have observed that you have made similar inquiry in another forum thread as well. We have responded with feedback in following thread.