Jump to content

newbie question about contact form on website


quartney

Recommended Posts

I'm super-frustrated because I can't get my contact us email form to work on the freehostia.com servers (and I have a paid plan).  I have made three different versions and none of them work.  HOWEVER, I've uploaded each of them to a website hosted by a different company and they all work there.  Freehostia support put a mail.php file on my account to prove that the mail function works.  And the thing is, that mail.php page does send me mail! 

 

So, at it's basic, here is the code I'm using to send me email from our contact us page.  I am redirected to the contactthanks.html (success) page--I just am not receiving any email at my account afterwards.

 

Does this code look okay?  Do you have any suggestions as to what I'm doing wrong?  Thanks!

<?php

$EmailFrom = "[email protected]";
$EmailTo = "[email protected]";
$Subject = "KLEAN E-update signup";
$Name = Trim(stripslashes($_POST['Name'])); 
$Email = Trim(stripslashes($_POST['Email'])); 

// 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 .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";

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

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

 

Archived

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

×
×
  • 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.