好的,
因此,我向我的用户设置发送了电子邮件通知,但他们收到通知说它来自notifications@domain.com。相反,我希望它在收件箱中显示为“名称/标题”而不是电子邮件地址。
这是我到目前为止所得到的:
$settings['notification'] = 'Notifications <notifications@domain.com>';
function nemail($to,$subject,$tpl,$var=array())
{
global $settings;
extract($var, EXTR_OVERWRITE);
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=utf-8" . "\r\n";
$headers .= 'From: '. trim($settings['notification']) . "\r\n" .
'Reply-To: '. trim($settings['notification']) . "\r\n";
ob_start();
ob_implicit_flush(false);
require(realpath("themes/".$settings['theme']."/template/email_".$tpl.".php"));
$message = ob_get_clean();
@mail($to, $subject, $message, $headers);
}