Reputation: 5
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
Upvotes: 0
Views: 78
Reputation: 5239
You don't have a $to
address. Moreover, please remove the @
and don't suppress the errors.
Also, check if the $headers
are defined.
Upvotes: 2
Reputation: 1375
Take a look at PHPMailer Library. It is used by many php developers, it is very easy to use and is powerful as well.
Upvotes: -1