我正在尝试使用mail / denounce类型的东西: 有邮件组,您加入邮件组并留下邮件组,您可以通过按下按钮向整个邮件组发送电子邮件,当您按下按钮时,您将被定向到您将放置表单的页面,然后点击发送
运行以下代码:
$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)
提前感谢所有帮助