1

我正在尝试让邮件/谴责类型的东西起作用:有邮件组,您加入一个邮件组并离开一个邮件组,您可以通过按一个按钮向整个邮件组发送一封电子邮件,当您按下按钮,您将被定向到将放置表单的页面,然后单击发送

以下代码运行:

    $new_subject = $_POST['subject'];
$new_message = $_POST['message'];
// subject and message posted from the forum
if ($new_subject&&$new_message){

    $query = mysql_query("SELECT * FROM mail_groups");
    while($row=mysql_fetch_assoc($query)){
    $id = $row['id'];
    }
// Selects all mail groups, and gets their ID
    $query6 = mysql_query("SELECT * FROM mail_group_members WHERE gid='$id'");
// Selects the members' email out of the specific mail group where the group id is ID
    while($row3=mysql_fetch_assoc($query6)){
        $send_to = $row3['email'];
    // sets the send_to variable, which is different to each user (this is the user's email) 

    mail($send_to,$new_subject,$new_message,$headers);
// tries to send email, but nothing happens, no error messages, nothing
}
header("Location: mail.php");
// redirects to main mail page
}

我在 php.ini设置了 SMTP 服务器(作为我的 ISP-s)

提前感谢所有帮助

4

0 回答 0