Archived Forum Post

Index of archived forum posts


To address changing encoding

Aug 03 '15 at 22:42


we are using the Chilkat.NET IMAP library v9.5.0.51 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?= <>, OAM <>, "OAM Reservierungen" <>

When using the EmailBundle.GetEmail(int).GetTo(int) method, the values retrieved are:

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 v9.5.0.39 and everything seems to be fine in our database. We upgraded due to instabilities in the older version:

System.AccessViolationException Stack: at <Module>.ClsImap.FetchBundle(ClsImap, ClsMessageSet, ProgressEvent*) at Chilkat.Imap.FetchBundle(Chilkat.MessageSet)



This also applies to the Cc addresses.


We have implemented a workaround for this. It seems that Email.GetToAddr(int) and Email.GetToName(int) and the corresponding Email.GetCcAddr(int) and 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 :-)

Thanks again,



This new .NET build should fix it:

32-bit Download:
64-bit Download:

(This is the build for the .NET 4.5 Framework. If you need something else, please let me know..)