Email Form Issues!


I’ve created this landing page and the email form worked perfectly on one server, works well here…

But when uploaded the files and everything to the Wanson Lumber server it doesnt send it goes to the Error page, how can I resolve this, the client is asking what Mail Server am I using as they do not allow emails to send out or something like that their firewall doesnt allow it. Here is the Wanson Lumber page…



What is the contents of contactengine.php ?
Post the source code here (in proper code tags) and we can help you.

Here is the code…


$EmailFrom = Trim(stripslashes($_POST['Email']));
$EmailTo = "";
$Subject = "Wanson Lumber Email Form";
$Name = Trim(stripslashes($_POST['Name']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));

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

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$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\\">";
  print "<meta http-equiv=\\"refresh\\" content=\\"0;URL=error.html\\">";

Any ideas on why it works one place and not the other?

First of all, have you checked the junk mail folder of the receiving account to see if the mail is being flagged as spam? Differences in the setup of the sending server can cause that sometimes.

Secondly, what is the hosting situation of the website? You mention the client’s firewall possibly being a problem - does that mean that they are hosting the site from their own server rather than a hosting company?

They are using their own server called SEDNA. He made it so can send emails but still couldnt. Not going to the Junk Mail thing, is when I submit it goes to the Error page on the website but not on the is this something I can solve or is it on their end?


I would try to check the log for whatever program is responsible for sending the email for PHP. On linux-based servers this is often sendmail, so you could try checking the log (see here for possible sendmail log locations) and seeing if there’s an error msg that might throw some more light on the problem.

Is this something I would be doing as I’m not sure what program or server type they are using all they supplied me with is FTP information.

Your code looks OK to me, and it obviously works for you in your test environment. It seems that the problem could well be with the server email setup. At the very least, that would be the next place to look to try and solve the problem. If you don’t have access to the server (other than via FTP) then it’s difficult for you to do much else.

Ok, I’ve contact them letting them know this that theres not much I could do from here on out. I believe its Windows based on not Linux if I can recall.