I\'m trying to use the code below to send messages via System.Net.Mail and am sometimes getting subjects like \'=?utf-8?B?W3AxM25dIEZpbGV
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:
"=?utf-8?Q")"=?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.