我正在为我的网站设置电子邮件。当我发送显示订阅价格的试用提醒电子邮件时,收到的电子邮件显示的价格不正确。这是电子邮件的代码模板:
$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>";
问题部分是订阅价格。美元符号在电子邮件中显示正确,但英镑和欧元显示如图所示。
想知道是否有人可以帮我解决这个问题。谢谢
最佳答案
您不需要使用 HTML 实体 - 而且它们无论如何都无法在纯文本电子邮件中使用。完成这项工作的最简单方法是:
$mail->CharSet = 'utf-8';
然后您可以按原样使用文本,无需任何编码。
关于php - 货币符号在电子邮件中无法正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67452188/