-1

有一个标准说您可以从多个电子邮件地址发送。我的意思是发件人标头可以有多个电子邮件地址。

https://www.rfc-editor.org/rfc/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);
?>
4

1 回答 1

5

试试这个,希望它会工作

$headers =  "From: Website  <webmaster@example.com,dat@teddy.com> \r\n";

或这个

$headers =  "From: WebMaster <webmaster@example.com>, Dat<dat@teddy.com> \r\n";
于 2012-10-11T12:15:21.483 回答