Topic: PHP email problem (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Topic: PHP email problem (Page 1 of 1)" rel="nofollow" >Topic: PHP email problem <span class="small">(Page 1 of 1)</span>\

Nervous Wreck (II) Inmate

Insane since: Sep 2005

IP logged posted posted 06-13-2006 16:37 Edit Quote

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:

$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>";

$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'];


Maniac (V) Mad Scientist

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

IP logged posted posted 06-13-2006 19:20 Edit Quote

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.

Post Reply
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
Your Text:
Options: Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu