PHP mail special characters in subject field

后端 未结 3 1715
粉色の甜心
粉色の甜心 2020-12-31 03:26

I would like to insert special characters in the subject of HTML e-mails sent with the PHP mail() function.

I want my subject to look like this:

★ Yo

3条回答
  •  梦谈多话
    2020-12-31 04:19

    Try for subject:

    $sub = '=?UTF-8?B?'.base64_encode($subject).'?=';
    

    And then:

    mail($to, $sub, $message, $headers);
    

提交回复
热议问题