dongpian6319 2013-07-30 10:05
浏览 43

带有UTF-8 PHP的电子邮件标题[重复]

This question already has an answer here:

I want to put UTF-8 characters in the from part of an email.

Every part of the message is UTF-8 and it's working correctly except the FROM part.

I'm using this:

//boundary
    $div = "==Multipart_Boundary_x".md5(time())."x";
    //headers
    $head = "From: $name
".
        "MIME-Version: 1.0
".
        "Content-Type: multipart/mixed;
".
        " boundary=\"$div\"";

$name has UTF-8 characters and I can display correctly it in the message body.

I have tried with "\xEF\xBB\xBF" .$name" and still it's not working.

What am I doing wrong?

</div>
  • 写回答

1条回答 默认 最新

  • dongmei9961 2013-07-30 10:09
    关注

    Don't reinvent the wheel, use some library:

    http://swiftmailer.org/

    http://framework.zend.com/manual/1.12/en/zend.mail.html

    there are others

    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序