0

有两个步骤,首先我发送给需要时事通讯的人的电子邮件,第二封电子邮件需要发送到 info@dirtytrend.com。问题是电子邮件是在第一步中发送的,但第二步中的电子邮件永远不会通过,但代码似乎继续进行而没有任何错误。

代码如下

<?php


$name = $_POST["nameofperson"];
$to = $_POST["emailofperson"];
$subject = "Hi!";
$body = "Hi " . $name . ",<br><br>Thank you for subscribing?\n\nWe have logged your email to process your newsletter and you will recieve an email from us confirming your subscription.";

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


if (mail($to, $subject, $body, $headers)) {



    $body2 = "Name: " . $name . "\n";
    $body2 .= "Email: " . $to;
    if(mail("info@dirtytrend.com", "Subscription Request", $body2)){

        header("Location: http://www.dirtytrend.com/events.html");
    }
    else{

    }

 } else {
    echo "ERROR: Email not sent please contact the system administrator";
 }
 ?>
4

1 回答 1

0

在第二个 mail() 中,您只有 3 个参数,而您缺少带有标题的第 4 个参数,所以它可能被识别为垃圾邮件?

于 2013-03-11T18:49:11.943 回答