Pergunta

I have a program that runs on .NET. A client is having a problem that appears to be an email encoding issue. Question marks are showing up in the email body; I've changed the encoding to UTF. Still a problem.

CHARLOTTE, N.C. (AP) — The Republican National Committee is holding its winter meetings in the North Carolina city where Democrats re-nominated Barack Obama for president four months ago.

Shows up like this:

CHARLOTTE, N.C. (AP) ??? The Republican National Committee is holding its winter meetings in the North Carolina city where Democrats re-nominated Barack Obama for president four months ago.

The encoding for the email message is set to UTF-8.

MailMessage.BodyEncoding = System.Text.Encoding.UTF8;

From the HTML header in the email:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Here is the really odd thing:

  • The problem is happening on Windows and Mac
  • I am subscribed to this list and the emails display fine on my end.
  • I am running Outlook 2013 with Exchange 2010; they are on Outlook and some other programs, not sure which.

Could there be some security software installed that would mess this up? Could UTF-16 work?

Foi útil?

Solução

This is happening because some email programs don't like high ASCII characters in HTML. Convert all high ASCII characters to HTML equivalent.

Sloppy .NET version on StackOverflow: More advanced .NET HTML Encoding

Also more on HTML and ASCII: Sonic's Ultimate HTML Character Set pages

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top