当前位置: 动力学知识库 > 问答 > 编程问答 >

mysql data to email from php

问题描述:

Shown data from mysql query in php file:

while ($row = mysql_fetch_array($sql)){

echo 'ID: '.$row['ID'];

echo ' First Name: '.$row['First'];

echo ' Last Name: '.$row['Last'];

echo ' Phone: '.$row['Phone'];

}

I need to send those results to email

How to do this? like:

$message = 'ID: '.$row['ID'];

not working: I receive message "ID:" without result

网友答案:

You don't have a $to address. Moreover, please remove the @ and don't suppress the errors. Also, check if the $headers are defined.

网友答案:

Take a look at PHPMailer Library. It is used by many php developers, it is very easy to use and is powerful as well.

分享给朋友:
您可能感兴趣的文章:
随机阅读: