我的下面的代码没有发送电子邮件,当点击链接时,它应查询数据库然后发送电子邮件。 我做错了什么指针? 谢谢你的帮助。
<?php
require_once('dbconnect.php');
$query="SELECT * FROM Locations WHERE id='$id'";
$result=mysql_query($query);
while ($row = $result -> fetch_assoc()) {
$submitter = $row['submitter'];
$submitteremail = $row['submitteremail'];
$message .= "$submitter";
}
$to = "$submitteremail";
$subject = "Submission approved";
$from = "wxyz@mail.com";
$headers = "From:".$from;
mail($to, $subject, $message, $headers);
echo 'Email sent';
mysql_close();
exit();
&GT;