PHP mail()

Hi, I'm new to PHP, but I've been helping out user "king" in the HTML forums, who wanted form input to be mailed to him. (If you want to see the exact question and my PHP solutions, please go to the HTML Website Design section and check "Email and new page").

I know how to use mail() and all (syntax-wise, never tried it), but I've only been able to test it on a free hosting service (my server broke), and the mail's not working.

This is my code:

<?php
mail("[email protected]","New Signup","Account Name: $acName\n
Password: $psWord\nEmail Address: $emAddress");
mail($emAddress,"Confirmation","Thankyou! We have received your email.");
?>


(I'm emailing two people). Of course, I've changed "[email protected]" when I tested it. $acName, $psWord, $emAddress are all defined in a previous script. I am pretty sure they are working.

I've read stuff about smtp and php.ini and ... i don't know what this stuff is. maybe that's the problem? i don't know, someone please help me, thankyoujut to rule out any possiblities with your mesage lets put them in a variable all by themselves.


<?php
$message = "Account Name: $acName\n
Password: $psWord\nEmail Address: $emAddress";

$conformation_message = "Thankyou! We have received your email.";

mail("[email protected]","New Signup", $message);
mail($emAddress,"Confirmation",$conformation_message);
?>

now, that should work. if it doesn't what errors are you getting? in you don't get any errors then it does work. So we need to chck the variables so that we now that it gets sent to the correct email.thanks scoutt!!! as soon as i get a new host i'll try it out lol stupid hosts that shut down on you after 2 months of service - i hate them
 
Back
Top