title: PHPMailer HTML not rendering
body: <p>I am using PHPMailer to send HTML emails.  It sends the emails fine, but the HTML does not render in the email clients.  I've tested this with web-based GMail and OSX mail.app IMAP'ed to the same GMail account.  Neither render properly.  </p>
  
  <p>I'm pulling my hair out to solve this.  Any ideas???</p>
  
  <p>PHP Code to format the email to send (the emails get sent so that is working):</p>
  
  <pre><code>// mail format settings
  // $mail-&gt;WordWrap = 50;        // set word wrap to 50 characters
  $mail-&gt;IsHTML(true);            // set email format to HTML
  $mail-&gt;CharSet="UTF-8";         // set the charset to UTF-8
  $mail-&gt;Encoding = '7bit';
  $body = '';
  $body .= "&lt;!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"&gt;";
  $body .= "&lt;html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"&gt;";
  $body .= "&lt;head&gt;";
  $body .= "&lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /&gt;";
  $body .= "&lt;meta http-equiv=\"Content-Language\" content=\"en-us\" /&gt;";
  $body .= "&lt;style&gt;";
  $body .= "body {font-family:\"trebuchet ms\", arial, \"san serif\";font-size:14px;}";
  $body .= ".email-header{ margin:5px;padding:20px;background:#dddddd;border-radius:10px;color:#000000;font-size:24px;font-weight:bold;}";
  $body .= ".email-body{margin:10px 20px;}";
  $body .= "&lt;/style&gt;";
  $body .= "&lt;/head&gt;";
  $body .= "&lt;body&gt;"; 
  if ($_POST["type"]=='confirmation') {
  
      // set the email body
      $body .= "&lt;div class=\"email-header\"&gt;Sky Lodge HOA Reservation Confirmation&lt;/div&gt;";
      $body .= "&lt;div class=\"email-body\"&gt;";
      $body .= "Dear ". $_POST["name"] . ",&lt;br/&gt;&lt;br/&gt;";
      $body .= "This email is confirming your reservation for unit nnn x:&lt;br/&gt;";
      $body .= "&lt;strong&gt;Arriving:&lt;/strong&gt; date&lt;br/&gt;";
      $body .= "&lt;strong&gt;Departing:&lt;/strong&gt; date&lt;br/&gt;&lt;br/&gt;"; 
      $body .= "Please click here to view your existing reservation(s):&lt;br/&gt;";
      $body .= "http://www.somesite.com/index.php?token=" . $_POST["token"] . "&lt;br/&gt;&lt;br/&gt;";
  
      // set the email subject
      $mail-&gt;Subject = "Sky Lodge HOA: Reservation Confirmation";
  
  } else if ($_POST["type"]=='notify') {
  
      // set the email body
      $body .= "&lt;div class=\"email-header\"&gt;Sky Lodge HOA Attention Required&lt;/div&gt;";
      $body .= "&lt;div class\"email-body\"&gt;";
      $body .= "Dear ". $_POST["name"] . ",&lt;br/&gt;&lt;br/&gt;";
      $body .= "It is your turn to make a reservation for unit nnn x.&lt;br/&gt;&lt;br/&gt;";
      $body .= "Please click here to make your reservation:&lt;br/&gt;";
      $body .= "http://www.somesite.com/index.php?token=" . $_POST["token"] . "&lt;br/&gt;&lt;br/&gt;";
  
      // set the email subject
      $mail-&gt;Subject = "Sky Lodge HOA: Attention Required";
  
  }
  $body .= "Thank You,&lt;br/&gt;Patti Rea";
  $body .= "&lt;/div&gt;";
  $body .= "&lt;/body&gt;";
  $body .= "&lt;/html&gt;";
  echo('$body: ' . $body);
  $mail-&gt;Body = $body;
  $mail-&gt;AltBody = "This is the body in plain text for non-HTML mail clients";
  </code></pre>
  
  <p>Resulting mail:     </p>
  
  <pre><code>Return-Path: &lt;darren@theehlers.org&gt;
  Received: from skylodge (c-174-52-123-157.hsd1.ut.comcast.net. [174.52.123.157])
          by mx.google.com with ESMTPS id ko12sm7817099pbb.52.2012.02.29.11.02.07
          (version=SSLv3 cipher=OTHER);
          Wed, 29 Feb 2012 11:02:07 -0800 (PST)
  Date: Wed, 29 Feb 2012 12:02:05 -0700
  Return-Path: darren@theehlers.org
  To: Sky Lodge &lt;darren@theehlers.org&gt;
  From: Darren Ehlers &lt;darren@theehlers.org&gt;
  Cc: kathi@theehlers.org
  Reply-To: Darren Ehlers &lt;darren@theehlers.org&gt;
  Subject: Sky Lodge HOA: Reservation Confirmation
  Message-ID: &lt;9941ff8576a1763200e134b5b313b1b1@skylodge&gt;
  X-Priority: 3
  X-Mailer: PHPMailer 5.2.1 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
  MIME-Version: 1.0
  Content-Type: multipart/alternative;
      boundary="b1_9941ff8576a1763200e134b5b313b1b1"
  
  
  --b1_9941ff8576a1763200e134b5b313b1b1
  Content-Type: text/plain; charset="UTF-8"
  Content-Transfer-Encoding: 7bit
  
  This is the body in plain text for non-HTML mail clients
  
  
  --b1_9941ff8576a1763200e134b5b313b1b1
  Content-Type: text/html; charset="UTF-8"
  Content-Transfer-Encoding: 7bit
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;meta http-equiv="Content-Language" content="en-us" /&gt;
  &lt;style&gt;
  body {font-family:"trebuchet ms", arial, "san serif";font-size:14px;}
  .email-header{ margin:5px;padding:20px;background:#dddddd;border-radius:10px;color:#000000;font-size:24px;font-weight:bold;}
  .email-body{margin:10px 20px;}&lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="email-header"&gt;Sky Lodge HOA Reservation Confirmation&lt;/div&gt;
  &lt;div class="email-body"&gt;
  Dear Sky Lodge,&lt;br/&gt;&lt;br/&gt;
  This email is confirming your reservation for unit nnn x:&lt;br/&gt;
  &lt;strong&gt;Arriving:&lt;/strong&gt; date&lt;br/&gt;
  &lt;strong&gt;Departing:&lt;/strong&gt; date&lt;br/&gt;&lt;br/&gt;
  Please click here to view your existing reservation(s):&lt;br/&gt;
  http://www.somesite.com/index.php?token=WQ85o7OiT9&lt;br/&gt;&lt;br/&gt;
  Thank You,&lt;br/&gt;
  Patti Rea
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  --b1_9941ff8576a1763200e134b5b313b1b1--
  </code></pre>