Jump to content

Archived

This topic is now archived and is closed to further replies.

spramod

PHP FORM - EMAIL

Recommended Posts

I have a problem with this form. I tried using this form to be posted from my website, it works fine on one server meaning, I receive the email when the 'TO' address is 'xyz@email.com', but on another server, where the email address is 'lmn@help.com', i dont receive the email.

Can anybody tell me what the problem is? I need to get this working on the server which I dont receive this form.
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("connection.php");

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


$to="jobs@email.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);
?>

Thanks every one for help..

Share this post


Link to post
Share on other sites
thanks for your reply,
previously i had a contact form on the same server.
that still works fine,
but now i have another for job application and with this i dont receive any emails.
i tried a test email with just 2 fields that also is not working..
any ideas!!!
thanks for the help..

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.