UTF-8 is a variable-width character encoding used for electronic communication. Defined by the Unicode Standard, the name is derived from Unicode (or Universal Coded Character Set) Transformation Format – 8-bit.
UTF-8 is the universal code page for internationalization and is able to encode the entire Unicode character set. It is used pervasively on the web, and is the default for *nix-based platforms.
UTF-8 is an 8-bit variable width encoding. The first 128 characters in the Unicode, when represented with UTF-8 encoding have the representation as the characters in ASCII.
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...'
(trimmed). This is the code that's called:
MailMessage message = new MailMessage() { From = new MailAddress("[email protected]", "Service"), BodyEncoding = Encoding.UTF8, Body = body, IsBodyHtml = true, ReplyTo = new MailAddress("[email protected]"), SubjectEncoding = Encoding.UTF8 }; foreach (string emailAddress in addresses) { message.To.Add(new MailAddress(emailAddress.Trim(), "Person")); } message.Subject = subject;
I'd like to emphasize that this does not happen all of the time.
What am I doing wrong?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With