3

这是我的代码

$subject = "Welcome to Last Alliance Standing";
$message = "$name Welcome to Last Alliance Standing, Your account has been registered and you are now able to login and play";
$headers  = "From: Team Laser<noreply@lastalliancestanding.com>\r\n";
$headers .= "X-Mailer: Drupal\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

if (mail($email, $subject, $message, $headers)) {   
    header("location: passwordrequest-success.php");
    exit();
} else {
    echo "Not Sent";    
}

电子邮件并不总是发送,尽管有时会发送,但有时我会收到“未发送”错误

4

3 回答 3

0

如果您的主机使用 Windows 系统,更改此行可能会有所帮助

$headers  = "From: Team Laser<noreply@lastalliancestanding.com>\r\n";
$headers  = "From: noreply@lastalliancestanding.com\r\n";

也不$email应该是这种形式。Alias <mail@ress.com>

于 2012-12-19T04:03:39.297 回答
0

The first thing you have to do is check does your server support mail function. After that, you can put mail() into try{}catch(){} to catch error code :)

于 2012-12-19T02:57:33.583 回答
0

感谢那些有提示的人,我联系了帮助台(今天第四次)并最终到达了某个地方,因为它是一个共享帐户,其他帐户之一发送了大量垃圾邮件,现在已经修复,不过谢谢大家的帮助

于 2012-12-19T04:39:46.957 回答