title: php mail with utf-8 encoding displays incorrectly in Microsoft mail clients
body: <p>I've searched and searched for a solution to this but to no avail.</p>
  
  <p>I'm using the php mailer to send out a mixed text / html email, encoded in utf8. Here's the relevant code:</p>
  
  <pre><code>$headers = "From: $fromPerson\r\n" .
  "Content-Transfer-Encoding: 8bit\r\n".
  "Reply-To: $fromPerson\r\n" .
  "Content-Type: multipart/alternative; boundary=". $mime_boundary_header. "\r\n" .
  "X-Mailer: PHP/" . phpversion();
  
  $message = "$notice_text
  
  --$mime_boundary
  Content-Type: text/plain; charset='UTF-8'
  Content-Transfer-Encoding: 8bit
  
  $textEmail
  
  --$mime_boundary
  Content-Type: text/html; charset='UTF-8'
  Content-Transfer-Encoding: 8bit
  
  $htmlEmail
  
  --$mime_boundary--";
  
  //mb_detect_encoding($message) returns UTF-8
  $mail_sent = @mail( $to, $subject, $message, $headers);
  </code></pre>
  
  <p>The messages contain Spanish along with those tricky characters. The emails display fine in gmail, hotmail (online outlook), mac mail, phones etc. but not in Windows live mail or Microsoft outlook.</p>
  
  <p>If I manually set the default font in Windows live Mail to utf8 the message displays correctly, but otherwise it does not. If I forward the email from another client to outlook or windows live it displays fine as well.</p>
  
  <p>I could find work arounds I'm sure, but am I missing something? I don't want to rely on the receivers knowing how to change the encoding of the message, so is there something I need to add to the email to prompt these clients to recognise the encoding?</p>
  
  <p>I apologise if this has been dealt with elsewhere, and I'll appreciate any advice. It looks like I should just go ahead and use PHPMailer to see if that fixes the problem, but out of personal curiosity it would be interesting to learn why this is happening...</p>