Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Quboid

macrumors 6502
Original poster
Oct 16, 2006
441
0
everywhere
Hello all,

I am having some trouble with the php mail() function. I followed a few tutorials online, but although the script is being processed, the mail never makes it to my inbox. Can anyone help me out? I'm sure its a simple mistake.

thanks a million!

this is the php script I wrote.

Code:
<?

$name=$_POST['name'];
$from_header=$_POST['email'];
$destino=$_POST['destino'];
$origen=$_POST['origen'];
$hotel=$_POST['hotel'];
$adult=$_POST['precio_adult'];
$child=$_POST['precio_child'];
$calif=$_POST['calif'];
$subject="stuff";

$headers = "From: zesco727@hotmail.com";

//echo"$name";

$contents= $name."<br>Destino: ". $destino."<br>Origen: ".$origen."<br>Hotel: ".$hotel."Precio Adulto: ".$adult."<br>Precio Menores: ".$child;


$to="zesco727@gmail.com";

mail('stunnerfresh@yahoo.com', '$subject', '$contents','$headers');


?>

I a using MAMP..
 
There's no need to wrap variables in quotes.
Try
PHP:
mail('stunnerfresh@yahoo.com', $subject, $contents, $headers);

Also, your $to variable doesn't seem to be used anywhere.

finally, instead of <br> (or <br /> depending on your markup version) you can use PHP's newline: \n option.

It's always worth checking your error_log file to see where the error lies.
The location varies on hosts, but it's something like:
/var/log/httpd/error_log
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.