php中的mail()函数错误

时间:2014-09-14 02:26:53

标签: php sql email

当我运行此代码时,我没有收到任何错误消息,但是当我检查我的电子邮件时,它还没有发送。这是我的代码:

$con = mysqli_connect("localhost", "root", "chendu", "SriMeru");
        if (mysqli_connect_errno()){
            echo "Failed to connect to Server";
        }
    $sql = "SELECT email FROM users";
    $result = mysqli_query($con, $sql);
while ($row = mysqli_fetch_array($result)){
        mail($row['email'], $subject, $message,"From: $from\n");
        echo $row['email'] . $subject . $message . $from . "<br>";
    }
    echo"Successful Email";

有什么想法吗?

0 个答案:

没有答案