【发布时间】:2015-10-08 10:52:02
【问题描述】:
我正在使用XAMPP,当我使用 PHP mail() 函数发送电子邮件时,主题出现了两次(例如“你好,你好”)。
PHP 代码:
$from="me@gmail.com";
$to="you@gmail.com";
$subject="hello";
$message="this doesn't work nicely";
$headers = 'From: '.$from."\r\n".
'Subject: '.$subject."\r\n".
'Mime-Version: 1.0'."\r\n";
mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $headers);
有人知道解决办法吗?
【问题讨论】:
-
只需将其从
$headers中删除即可。