title: Pass html variable from Ajax to PHP
body: <p>I am trying to use this code to pass via POST a variable containing HTML</p>
  
  <pre><code>var data = {
      message: $('#mydiv').html()
  };
  jQuery.ajax({
      type: 'POST',
      data: data,
      url: '/myurl?action=send_email',
      success: function( response ) { }
  });
  </code></pre>
  
  <p>In PHP, I retrieve the data and I send an Email using the data content</p>
  
  <pre><code>$message = "Hello&lt;br&gt;" . $_POST['message'] . "&lt;br&gt;Bye Bye";
  $mail = mail($email, $subject, nl2br($message), $headers);
  </code></pre>
  
  <p>The HTML within the email that I receive is badly formatted:</p>
  
  <pre><code>&lt;img width="\&amp;quot;70\&amp;quot;" height="\&amp;quot;87\&amp;quot;" alt="\&amp;quot;D_6928_antiqueoak_vapor\&amp;quot;"&gt;
  </code></pre>
  
  <p>Can someone tell me why and if there is a solution? Thank you a lot</p>