有一个标准表明您可以从多个电子邮件地址发送。我的意思是发件人标头可以有多个电子邮件地址。
http://tools.ietf.org/html/rfc5322#section-3.6.2
我尝试了mail
函数的不同组合,但都没有。
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com, dat@teddy.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" . 'From: dat@teddy.com' . "\r\n"
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
答案 0 :(得分:5)
试试这个,希望它能起作用
$headers = "From: Website <webmaster@example.com,dat@teddy.com> \r\n";
或者
$headers = "From: WebMaster <webmaster@example.com>, Dat<dat@teddy.com> \r\n";