Search code examples
phphtmlphpmailerhtml-email

Currency Symbols not displaying correctly in emails


I am setting up email messaging for my site. When I send emails for trial reminders displaying subscription prices, the recieved email displayes them incorrectly. This is the code template for the email:

$message = '<html><head><meta charset="UTF-8"></head>';
$message .= '<body style="text-align: center">';
$message .= '<div style="padding: 30px; margin: 0 auto; display: block; background: lightslategray; height: 500px; ">';
$message .= '<div style="width: 80%; margin: 0 auto; display: block; background: white; height: 440px; padding: 30px ">';
$message .= '<div style="background-color: #343a40" >';
$message .= '<div style="padding: 10px ">';
$message .= '<div href="" style="font-size: 23px;text-align: center; color: orange; margin: 0 5px;padding-bottom: 10px;border-bottom: 1px solid lightgrey; ">';
$message .= '<a   style="color: orange;text-decoration: none;"></a>';
$message .= '</div>';
$message .= '</div>';
$message .= '</div>';

$message .= '<h2>Your Trial Ends In 1 Week </h2><br>';
$message .= '<p>Subcriptions are £10 Per Year $  €</p>';

$message .= '<br>';
$message .= '<br>';
$message .= '<br>';
$message .= '<br>';
$message .= '<p>For help or if you have any questions, <a href="">contact us or visit the FAQ section</a></p>';
$message .= '<a title="Follow us on Facebook" target="_blank" href=">Follow Us On Facebook</a>';


$message .= '</div>';
$message .= '</div>';
$message .= "</body></html>";

The part in questions is the Subscription prices. The dollar symbol displays correct in the email however pounds and euro display as in the picture.

Wondering if anyone can help me solf this. Thanks

enter image description here


Solution

  • Use html character entities.

    For £ use &pound; or &#x000A3; or &#163;

    For use &euro; or &#x020AC; or &#8364;