note 50638 deleted from ref.mail by tularis

From: Date: Sat, 05 Mar 2005 13:27:49 +0000
Subject: note 50638 deleted from ref.mail by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-85971@lists.php.net to get a copy of this message
Note Submitter: 3safiroo Reason: spam ---- Can we send mail using localhost ? I always get this error in the function mail($to, $subject, $message, $headers); . This is the code: <? $contents=$HTTP_POST_VARS['text']; $from = $_POST['from']; $subject = $_POST['subject']; $text=$HTTP_POST_VARS['text']; $to = 'something@Example.com'; $subject = '$subject'; $message = '$text'; $headers = 'From: webmaster@' . $_SERVER['SERVER_NAME'] . "\r\n" . 'Reply-To: webmaster@' . $_SERVER['SERVER_NAME'] . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if($from=="") { echo ("<script language='javascript'> alert(' Sorry, Type your E-mail Address please') window.location='contactus.htm' </script>"); } if($subject=="") { echo ("<script language='javascript'> alert(' Sorry, Type the E-mail subject please') window.location='contactus.htm' </script>"); } if($contents=="") { echo ("<script language='javascript'> alert(' Sorry, Type the comments please') window.location='contactus.htm' </script>"); } if($from!=""){ if($subject!=""){ if($message!=""){ mail($to, $subject, $message, $headers); } } } ?>

« previous php.notes (#85971) next »