我有一个脚本可以识别关卡,并且如果我已经通过了代码,我已经添加了一些提示以告诉我。这两个电子邮件地址是反映。我想单独发送两封电子邮件,但收件箱不工作。我检查了我的垃圾邮件。邮件不工作,不发送两封电子邮件
有什么,我失踪了吗?
function emaillog($to,$id,$subject,$message){
include("dbconnect.php");
mysql_query("INSERT INTO emlog(mm,tt,ss,rr) VALUES('$message','$to','$subject','$id')");
}
if($level == 1){
$assignedtowho_email_result = mysql_query("SELECT Email FROM sheet1 WHERE id IN(SELECT assignedtowho FROM tbl_one WHERE id =$id)");
while($row_email=mysql_fetch_array($assignedtowho_email_result)){
$assignedtowho_email=$row_email['Email'];
}
// Email Sending department
$to = $senderEmail;
$subject = "Refferal status updated by recieving r";
$message = "Your status has been updated by ";
$from = "[email protected]";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
emaillog($to,$id,$subject,$message);
$message_alert="Sender mail sent: ".$to;
echo '<script>alert("'.$message_alert.'")</script>';
//echo "Mail Sent.";
// Email Recieving department
$to = $assignedtowho_email;
$subject = "Refferal status updated ";
$message = "Your refferal status has been updated";
$from = "[email protected]";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
emaillog($to,$id,$subject,$message);
$message_alert_2="Assigned mail sent: ".$to;
echo '<script>alert("'.$message_alert_2.'")</script>';
//echo "Mail Sent.";
}
使用SMTP,你就用这个应该可以。 – Aristona
而不是使用邮件(...直接使用$ mailResult = mail(....然后检查$ mailResult是true还是false,如果它是真的,它不是php失败,但邮件服务器,也许你没有端口25(或定义的)打开或类似的东西 – aleation
检查你的smtp设置 –