we are using the Chilkat.NET IMAP library v220.127.116.11 to fetch emails from a mail server. Most of the time, this works fine. For some mails, however, the "To" address changes encoding, and the returned string contains the actual mime encoded string. The mail header I see using a different tool is:
To: =?iso-8859-1?Q?VL_Auftr=E4ge?= <VLAuftraege@example.com>,
OAM <OAM@example.com>, "OAM Reservierungen"
When using the
EmailBundle.GetEmail(int).GetTo(int) method, the values retrieved are:
"OAM Reservierungen" <email@example.com>
As you can see, the first address' encoding is changed from iso-8859-1 to UTF-8, and it is returned as a mime encoded string, not as a decoded .NET string. Is this a bug in your library or are we using it wrongly?
Thanks for your help and kind regards,
This seems to be an issue, that was introduced with a new version of the library. Before, we were using v18.104.22.168 and everything seems to be fine in our database. We upgraded due to instabilities in the older version:
at <Module>.ClsImap.FetchBundle(ClsImap, ClsMessageSet, ProgressEvent*)
This also applies to the Cc addresses.
We have implemented a workaround for this. It seems that
Email.GetToName(int) and the corresponding
Email.GetCcName(int) methods deliver the decoded data correctly. So, we now store the email address as:
MailAddress ma = new MailAddress(email.GetToAddr(i), email.GetToName(i)); to = ma.ToString();
An actual bugfix, or an information that this is the intended behavior of the library, and the "workaround" is the way to use the library is greatly appreciated :-)
This new .NET build should fix it:
(This is the build for the .NET 4.5 Framework. If you need something else, please let me know..)