Customers email displays HTML tags on PHP system generated mail

153 views Asked by At

When I send a really basic HTML email via a file using PHP mail it displays perfectly for me. But for my client he sees all the HTML tags in the email.

I have my own dedicated server, to try to problemsolve I ran the exact same file from a Heart Internet shared server I have and the email displayed perfectly to my client (no HTML tags) so it points to something to do with the server.

<?php
$to  = '[email protected]'; 
$subject = 'TOM Testing: HTML displaying correctly?';

$message = '
<html>
<head>
  <title>This is a test</title>
</head>
<body>
  <p>To see if</p>
  <table>
    <tr>
      <th>You</th><th>See</th><th>The</th><th>HTML</th>
    </tr>
    <tr>
      <td>or</td><td>it</td><td>is</td><td>formatted</td>
    </tr>
    <tr>
      <td>correctrly</td><td>1</td><td>2</td><td>abc</td>
    </tr>
  </table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


// Mail it
mail($to, $subject, $message, $headers);
?>

Here is my php info: http://www.saloponline.co.uk/phpinfo.php

0

There are 0 answers