Link to home
Start Free TrialLog in
Avatar of DS928
DS928Flag for United States of America

asked on

Email Messages Not Showing

I am building an E-Mail message from a MySQL database.  The problem is that only the last message is showing and only the label at that.  What am I doing wrong?

$to = $_POST['ESend'];
 	$subject = "Menuhead.com";
 	$message = "Name: ".$_POST["RestName"]."\n";
	$message = "Address: ".$_POST["StreetNumber"]."\n";
	$message = "Address: ".$_POST["StreetName"]."\n";
	$message = "Address: ".$_POST["CrossOne"]."\n";
	$message = "Address: ".$_POST["CrossTwo"]."\n";
	$message = "City: ".$_POST["CityName"]."\n";
	$message = "State: ".$_POST["StateName"]."\n";
	$message = "Zip Code: ".$_POST["ZipCodeName"]."\n";
	$message = "Phone: ".$_POST["Phone"]."\n";
	$message = "Email: ".$_POST["Email"]."\n";
	$message = "Fax: ".$_POST["Fax"]."\n";
	$message = "SMS: ".$_POST["SMS"]."\n";
	
 	$from = "Menuhead.com";
 	$headers = "From:" . $from;
 	mail($to,$subject,$message,$headers);
 	echo "Mail Sent.";

Open in new window


I also wnat to combine the StreetNumber and StreetName fields together.  Thank you.
ASKER CERTIFIED SOLUTION
Avatar of ScorchD
ScorchD
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DS928

ASKER

Still not showing.  Here is the entire page, maybe the problem is somewhere else?

<?php
include("config.php");
$Lid = $_GET['Lid'];
$Lid = mysql_real_escape_string($Lid);  
mysql_query("SET CHARACTER SET utf8");
$sql=mysql_query("SELECT tblRestaurants.RestName,tblLocations.StreetNumber,tblLocations.Street,
	tblLocations.CrossOne, tblLocations.CrossTwo, tblCities.CityName,tblStates.StateName,tblZipCodes.ZipCodeName,
	tblLocations.Phone,tblLocations.Email, tblLocations.Fax, tblLocations.SMS, tblLocations.LocationID
	FROM tblLocations
	INNER JOIN tblRestaurants ON tblRestaurants.RestID = tblLocations.RestID
	INNER JOIN tblCities ON tblCities.CityID = tblLocations.CityID
	INNER JOIN tblStates ON tblStates.StateID = tblLocations.StateID
	INNER JOIN tblZipCodes ON tblZipCodes.ZipCodeID = tblLocations.ZipCodeID
	WHERE tblLocations.LocationID = '$Lid'");
	while($row=mysql_fetch_array($sql))
	{
	$RestName = $row['RestName'];
	$StreetNumber = $row['StreetNumber'];
	$Street = $row['Street'];
	$CrossOne = $row['CrossOne'];
	$CrossTwo = $row['CrossTwo'];
	$City = $row['CityName'];
	$State = $row['StateName'];
	$ZipCode = $row['ZipCodeName'];
	$Phone = $row['Phone'];
	$Email = $row['Email'];
	$Fax = $row['Fax'];
	$SMS = $row['SMS'];
	$Lid = $row['LocationID'];
	}
 
    $to = $_POST['ESend'];
 	$subject = "Menuhead.com";
 	$RestName = $_POST['RestName'];
	$Email = $_POST['Email'];
	$message=" Name: $RestName \n Email: $Email \n";
 	$from = "Menuhead";
 	$headers = "From:" . $from;
 	mail($to,$subject,$message,$headers);
 	echo "Mail Sent.";
 ?>

Open in new window