Question:
How to check mail() function in php?
ROCK
2009-12-17 06:01:08 UTC
I coded a php program using mail() function but I don't know how to check whether it is working or not. Will I receive a mail to the ID given in ' To ' parameter? Help Me...
Four answers:
anonymous
2016-12-16 14:45:31 UTC
maximum loose information superhighway internet hosting won't even provide you php! in spite of in case you gained php, even much less loose host grants you with SMTP (which you will desire to deliver php mail). Ask them is it extremely is enabled (I critically doubt!)
.Paul
2009-12-17 06:06:21 UTC
You can check when it's send by using and specifying an e-mail address.



mail('e-mail address here', 'subject', 'headers'. 'optional used parameters');
eric
2009-12-18 09:18:02 UTC
about mail(),you can visit this link: http://cn2.php.net/manual/en/function.mail.php



if mail has report error, it isn't working .
Jack M
2009-12-17 06:27:12 UTC
save as "mail.html"





















Name:





Phone: 





Email:









Zip code:







Please supply any additional

information:

















__________________________________________________________________________



save as "mail.php"






$subject = 'Message';

$webMaster = 'youremail.com';



$name = $_POST['Name'];

$phone = $_POST['Phone'];

$email = $_POST['Email'];

$zipcode = $_POST['Zipcode'];

$text = $_POST['Other'];



$subject = <<
Year: $name

Model: $phone



EOD;



$body = <<






Name: $name



Phone: $phone



Email: $email



Zipcode: $zipcode



EOD;



$headers = "From: $email\r\n";

mail($webMaster, $subject, $body, $headers);





header('Location: thankYou.htm');

?>



This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...