Jump to content

php mail


jopo

Recommended Posts

Yikes  :). Well, this is what I have so far but do not think I am approaching the solution correctly.

 

		while($row=mysql_fetch_array($result)){
		$message= "Name: ".$row['name'];
		echo $message;

		}
$email="***@***.com";
$to      = $email;
$subject = "Test";
mail($to, $subject, $message);


Link to comment
https://forums.phpfreaks.com/topic/127850-php-mail/#findComment-661907
Share on other sites

You are overwriting the value of $message each time through the loop. Here's how I would do this:

<?php
$tmp = array();
	while($row=mysql_fetch_array($result)){
			$tmp[] = "Name: ".$row['name'];
	}
$email="***@***.com";
$subject = "Test";
mail($email, $subject, implode("\n",$tmp));
?>

 

Ken

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/127850-php-mail/#findComment-661913
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.