Reputation: 1703
I am trying to send a html email via mail(), however gmail just displays the email as plain text, no mark up, eg:
mail("[email protected]", "<i>Italic Text</i>");
just appears as
<i>Italic Text</i>
Any ideas?
Upvotes: 3
Views: 1266
Reputation: 3100
Try it with css, the i tag is deprecated, not sure if that is causing it...
<span style='font-style:italic;'>Italic Text</span>
Or you could try using the em tag:
<em>Italic Text</em>
.
Upvotes: 0
Reputation: 1904
Have you set your email headers?
// 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);
If yes, do any other email clients have the same problem? Or is it just Gmail?
Upvotes: 3