0

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

Telu
  • 5
  • 2

2 Answers2

2

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

Teena Thomas
  • 5,139
  • 1
  • 13
  • 17
-1

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

Davit
  • 1,394
  • 5
  • 21
  • 47
  • 1
    What's wrong with using `mail`? Nothing. Op needs help determining why his/her attempted use of it is not working. – Madbreaks Jan 07 '13 at 21:00