Self Duplicated Email Script No Longer Works

Hi,

I have the following email processing script which works perfectly on one website I have. However I have tried to copy it onto another site and it no longer works. I have included the insert page, it is only the email term I am looking to send but whatever I try it work sending anything.

Could there be a setting on my server which could allow one site to work but stop one script from working?

<?php

$EmailFrom = ".com - Contact Us";
$EmailTo = "email@yahoo.com";
$Subject = ".com Contact Form";
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));

// validation
$validationOK=true;
if (!$validationOK) {
  print "<meta http-equiv=\\"refresh\\" content=\\"0;URL=error.htm\\">";
  exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\
";
$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "\
";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\
";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\
";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
  print "<meta http-equiv=\\"refresh\\" content=\\"0;URL=contactthanks.php\\">";
}
else{
  print "<meta http-equiv=\\"refresh\\" content=\\"0;URL=error.htm\\">";
}
?>
<div class="articleemailsignup">
	


<div id="contact-area">
		
			<form  name="loginForm"  method="post" action="/siteinfo/contactengine.php">
				<ul >
				
				
				<div id="contactareabox">
				<div id="contactareatitle">Newsletter Signup:</div>
					<div id="contactareacell">
				<input type="text" name="Email" id="Email" /></text>
				    </div>
				</div>
				
		
					</div>
									
			  	<div class="contactusbutton">

							<div class="user-area">
 <input type="submit" value="Submit" class="submit-button" />
		</div>	
		   	</div>	
	
		</ul>
        </form>
			
</div>

Yes. For example the new server might not have an mail server or the mail() function might not be implemented. If the host of the new server has a help desk, you might ask them about email.

<?php
// ...
$success = @mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

check what do you get from a


var_dump($success);

in case the result is false, you may also check


$weHaveMail = function_exists('mail');
var_dump($weHaveMail);

Is this the actual line?:

$EmailFrom = “.com - Contact Us”;

If it is, try a proper email address. (Plus, I have no idea if this’ll make any difference, just a suggestion: ) try the domain name being the same as the server you’re sending from.