System.Net.Mail and =?utf-8?B?XXXXX…. Headers

When your subject contains characters outside the ASCII range, then the mailing software must encode them (RFC2822 mail does not permit non-ASCII characters in headers). There are two ways to do this:

  • Quoted Printable (subject starts with "=?utf-8?Q")
  • Base64 (subject starts with "=?utf-8?B")

It appears that the framework has figured that the Base64 encoding is more efficient (=shorter) than the quoted-printable encoding. This makes sense when your subject contains relatively many characters outside the ASCII range.

To answer your question: You’re doing nothing wrong. That’s how internet mail with non-ASCII characters is supposed to look like. Of course, the software that reads such mail should detect and decode such subject fields.

Leave a Comment