Closed Thread Icon

Topic awaiting preservation: PHP email problem (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28074" title="Pages that link to Topic awaiting preservation: PHP email problem (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: PHP email problem <span class="small">(Page 1 of 1)</span>\

 
spramod
Nervous Wreck (II) Inmate

From:
Insane since: Sep 2005

posted posted 06-13-2006 16:37

I am trying to use this code to post a form to an email.
It works fine on one of my servers with one 'to' email address on of my servers. But when i change the 'to' address, on another mail server, I dont receive the email. Can you let me know what the problem is?
thanks so much,,
struggling with this.. i m not understanding what the problem is..
Thanks everybody for your help..


the code:

<?php
$request = array_map('trim',($_SERVER['REQUEST_METHOD'] == "POST") ? $_POST : $_GET) ;

//check for spam injection
$allfields = implode('',$request) ;
$nontext = $request ;
unset($nontext['message'] );
$nontextfields = implode ('',$nontext) ;
if ((strpos ($nontextfields,"\\r")!==false) ||
(strpos ($nontextfields,"\\n")!==false) ||
(strpos ($allfields,"Content-Transfer-Encoding")!==false) ||
(strpos ($allfields,"MIME-Version")!==false) ||
(strpos ($allfields,"Content-Type")!==false) ||
($request['checkfield']!=$check) ||
(empty($_SERVER['HTTP_USER_AGENT']))) die('Incorrect request') ; //stop spammers ?>


<?php include("connectionmtc.php");

$msg.="Name :\t$_POST[name]<br>";
$msg.="Telephone :\t$_POST[tel]<br>";
$msg.="Email :\t$_POST[email]<br>";


$to="test@mail.co.uk";
$subject= " Application Form" .$_POST['email'];
$headers.= "Reply-To: " .$_POST['email'];
$headers.="MIME-Version: 1.0\r\n";
$headers.="Content-type: text/html; charset=iso-8859-1\r\n";
$headers.="From:" .$_POST['email'];



mail($to,$subject,$msg,$headers);
?>

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-13-2006 19:20

It might be how the server is configured. The local server is most likely running its own mail server that is configured only to handle mails that are addressed to a local address. You might want to contact your hosting provider to find out how the mail server is setup.

They might also have a standard email script that they would like you to use. I know that a couple of my old hosts would disable your account if they found you using a non-supported mail form script.

« BackwardsOnwards »

Show Forum Drop Down Menu