0 votes

Hi

Got a HTML email (IsHtml = true), but we the two calls are called, I am getting some garbage data, not text, it seems to be in the wrong encoding..

Any ideas?

Thanks

牦浯欠湥਍਍਍਍䱍吠獥ㅴ਍慍歲瑥䰠慥敤⁲䅑‬湉⹣਍晏楦散瀠潨敮›〰〰〰〰〰硥⹴〰〰਍浅楡㩬洠瑬獥ㅴ浀...

by (200 points)
Please send raw eml data as zipped attachment to the support address you can find in this page footer.

You can find detailed instructions here:
https://www.limilabs.com/blog/i-have-problems-parsing-the-message

What is the component version you are using?
The version is: 3.0.15091.1036

I have downloaded the latest version. I will send the EML file as attachment.

1 Answer

0 votes

HTML stored within this message is incorrect:

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-16">
  </head>
  <body><p>from ken<br><br><br><br>ML Test1<br>

It claims it uses utf-16 charset whereas it is in utf-8 or ASCII (there aren't any national characters there)

Following code passes. It replaces utf-16 with correct utf-8:

IMail mail = new MailBuilder().CreateFromEmlFile("c:\\email.eml");

string correctHtml = mail.Html.Replace("charset=utf-16", "charset=utf-8")

mail.HtmlData.Data = mail.HtmlData.Encoding.GetBytes(correctHtml);

StringAssert.Contains("ML Test1", mail.GetBodyAsText());
by (301k points)
...