View Full Version : Help with php mail funciton..

Aug 31, 2008, 02:03 PM
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.



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


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


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


I a using MAMP..

Sep 1, 2008, 04:32 AM
There's no need to wrap variables in quotes.
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: