Hi Aspose support,
I have a problem where when I convert a word doc to MHTML for use in a MailMessage object, and part of that Word doc has a url with &path= as part of the url in the body, it converts it to a new line on the email sent.
The output is like the following
url.com/foo?bar
ath=blah
Expected output:
url.com/foo?bar&path=blah
I have tried several escape codes but they come across as plain text. I assume this is because MHTML does not support html escape codes but does support html special characters, as &p is a special character denoting a pagebreak, but & and & do not work.
Here is how I generate the MailMessage Object to be sent. (I set the subject and to address in different methods) the doc parameter is a template that gets filled in with variable data so I can’t just pass it into the MailMessage Body as plain text.
private MailMessage generateEmailFromWordTemplate(Document doc) {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
try {
doc.save(outStream, SaveFormat.MHTML);
ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
MailMessage message = MailMessage.load(inStream);
outStream.close();
inStream.close();
return message;
} catch (Exception e) {
return null;
}
}
Any ideas of how to display &p as plain text in MHTML