Email from PHP has broken Subject header encoding

前端 未结 3 1161
有刺的猬
有刺的猬 2020-11-27 11:51

My PHP script sends email to users and when the email arrives to their mailboxes, the subject line ($subject) has characters like a^£ added to the

3条回答
  •  佛祖请我去吃肉
    2020-11-27 12:49

    mb_encode_mimeheader() for UTF-8 strings can be useful here, e.g.

    $subject = mb_encode_mimeheader($subjectText,"UTF-8");
    

提交回复
热议问题