【问题标题】:Sending Hebrew subject in php mail goes Klingon...?在 php 邮件中发送希伯来语主题去克林贡语......?
【发布时间】:2011-05-28 06:54:48
【问题描述】:

我正在尝试发送带有希伯来语内容/主题的电子邮件,如下所示:

$to = 'email@email.com';
$subject = "איזה יום יפה היום"; 
$message = 'ממש יום יפה';

$headers = 'From: email@email.com' . "\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);

但是我在这个主题中得到的更多的是克林贡语而不是现代希伯来语。消息本身很好,只是主题搞砸了。

我能做什么? (我愿意接受任何黑客攻击)

【问题讨论】:

  • 在此过程中,您的字符编码已经严重混乱。据我所知,ISO-8859-1 中甚至没有任何希伯来字符!
  • @David 消息正常,问题出在主题...

标签: php email character-encoding email-headers


【解决方案1】:

Content-Type 只描述了消息的内容,而不是标题。您需要在 Subject 值上应用encoded-word encoding。请参阅my answer on PHP email header subject encoding problem 了解更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多