Jump to content

PHP FORM - EMAIL


spramod

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..
Link to comment
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..
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.