在php中的单个脚本中多次调用Mail函数

时间:2018-01-05 19:29:19

标签: php email

我在我的脚本中调用邮件功能2次,如下所示。但我没有收到第二封电子邮件。下面是我的代码...

    // Sending email to Client
    $toClient = $name . "<" . $email . ">";
    $header1 = 'From: Name 1 <'.$fromEmail.'>' . "\r\n" .
                'Reply-To: Owner <'.$fromEmail.'>' . "\r\n" .
                'X-Mailer: PHP/' . phpversion();
    $header1 .= "MIME-Version: 1.0\r\n";
    $header1 .= "Content-type: text/html\r\n";

    $mailSentToClient = mail($toClient, 'Email Sent to Owner', "Thank you for contacting, I will get back to you shortly. <br>\n-Owner", $header1);

    // Sending email to Owner
    $toOwner = 'Owner' . "<" . $ownerEmail . ">";
    $header2 = 'From: '.$name.' <'.$email.'>' . "\r\n" .
                'Reply-To: '.$name.' <'.$email.'>' . "\r\n" .
                'X-Mailer: PHP/' . phpversion();
    $header2 .= "MIME-Version: 1.0\r\n";
    $header2 .= "Content-type: text/html\r\n";

    $mailSentToOwner = mail($toOwner, 'New Message', $message, $header2);

有人能告诉我我的代码有什么问题吗?

先谢谢

0 个答案:

没有答案