我意识到这与这个问题相似,但是,我在发送给自己时只会收到一封双重电子邮件。我已经使用相同的脚本向其他人发送了电子邮件,他们收到了一封电子邮件。这是电子邮件脚本:
<?php
function sendEmail( $recipient, $sub, $msg )
{
$to = $recipient;
$subject = $sub;
$message = $msg;
mail( $to, $subject, $message );
}
?>
调用它的代码是这样的:
if( $retVal != FALSE ) // No errors in execution of report generation
{
$subject = "Successful Report";
$message = "The report was successfully generated.";
// Notify people about success
sendEmail( $mailto, $subject, $message );
echo "Successful report generation\n";
}
else // Error in report generation
{
$subject = "Unsuccessful Report";
$message = "The report failed to generate.";
// Notify people about failure
sendEmail( $mailto, $subject, $message );
echo "Report generation was unsuccessful\n";
}
其中 $retval 是system()的返回值。任何人都可以对这个问题有所了解吗?或者这是可以忽略的事情?
非常感谢
-生锈的