note 67128 rejected from ref.mail by nlopess

From: Date: Sat, 03 Jun 2006 16:09:29 +0000
Subject: note 67128 rejected from ref.mail by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-113130@lists.php.net to get a copy of this message
Note Submitter: idea08 at yahoo dot com ---- Hi, I'm trying to make a email form, but I keep getting this error, hope someone can tell me what is the problem, and I also I have posted the php and html I made here, so hoping someone can help me to take a look....thank you so much for your help and your time. ERROR: Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in e:\virtualhost\domains\house\INetPub\wwwroot\mailer.php on line25 Warning: Cannot modify header information - headers already sent by (output started at e:\virtualhost\domains\house\INetPub\wwwroot\mailer.php:25) in e:\virtualhost\domains\house\INetPub\wwwroot\mailer.php on line 27 My PHP file: <?PHP $to = "123@yahoo.com"; $subject = "Order"; $headers = "From: Green Customer"; $forward = 1; $location = "thanks.htm"; $date = date ("l, F jS, Y"); $time = date ("h:i A"); $msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n"; if ($_SERVER['REQUEST_METHOD'] == "POST") { foreach ($_POST as $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "\n"; } } else { foreach ($_GET as $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "\n"; } } mail($to, $subject, $msg, $headers); if ($forward == 1) { header("Location:$location"); exit; } else { echo "Thank you for submitting our form. We will get back to you as soon as possible."; } ?> My HTML file: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>※ Welcome 2 Green ※</title> <meta http-equiv="Content-Type" content="text/html; charset=big5"> </head> <body> <table width="400" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><form action="mailer.php" method="post"> <input type="hidden" name="usernum" value="314041547" /> <input type="hidden" name="cpv" value="2" /> <div style="padding: 2px;"> <div style="font: normal 11px Arial, Sans-Serif;">Name:<br> <input type="text" name="name" height="10" style=" font: normal 11px Arial, Sans-Serif;"> </div> <div style="padding-top: 8px; font: normal 11px Arial, Sans-Serif;">E-Mail:<br> <input type="text" name="email" height="10" style=" font: normal 11px Arial, Sans-Serif;"></div> <div style="padding-top: 8px; font: normal 11px Arial, Sans-Serif;">Phone:<br> <input type="text" name="email" height="10" style=" font: normal 11px Arial, Sans-Serif;"></div> <div style="padding-top: 8px; font: normal 11px Arial, Sans-Serif;">Event:<br> <select name="country" height="10" style=" font: normal 11px Arial, Sans-Serif;"> <option selected="true">Chooes your Event</option> <option>Golf</option> </select></div> <div style="padding-top: 8px; font: normal 11px Arial, Sans-Serif;">Comments:<br> <textarea cols="80" rows="10" name="comments" style=" font: normal 11px Arial, Sans-Serif;">Type your comments here.</textarea></div> <div style="padding-top: 8px; font: normal 11px Arial, Sans-Serif;"></div> <br> <input type="submit" name="submit" value="Submit"><input type="reset" name="reset" value="Reset" style="margin-left: 10px;"> </form> </td> </tr> </table> </body> </html>

« previous php.notes (#113130) next »