在 php 邮件中发送希伯来语主题会变成克林贡语...?
我正在尝试发送包含希伯来语内容/主题的电子邮件,如下所示:
$to = '[email protected]';
$subject = "איזה יום יפה היום";
$message = 'ממש יום יפה';
$headers = 'From: [email protected]' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
但我在主题中得到的更多是克林贡语而不是现代希伯来语。消息本身很好,只是主题搞砸了。
我能做些什么? (我对你的任何黑客持开放态度)
I'm trying to send email with hebrew content/subject like so:
$to = '[email protected]';
$subject = "איזה יום יפה היום";
$message = 'ממש יום יפה';
$headers = 'From: [email protected]' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
But what I get in the subject is more Klingon than modern Hebrew. The message itself comes out fine, it's just the subject that's all messed up.
What can I do? (I'm open to any hacks you got)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Content-Type 仅描述消息内容,但不描述消息头。您需要应用encoded-word编码 主题 值。请参阅我对 PHP 电子邮件标头主题编码问题的回答 了解更多信息。
The Content-Type does only describe the message content but not the header. You need to apply the encoded-word encoding on the Subject value. See my answer on PHP email header subject encoding problem for further information.