PHP Mail () tested script on other servers but doesn't work with BORU

Status
Not open for further replies.

sshapariya77

New Member
Messages
6
Reaction score
0
Points
0
The following script is a tested one with a different project and hosting provider and has been just stripped down in the number of data being collected but the structure is the same.

I have tried several attempts and have waited for more than 17 hours to see if there is a delay in receiving the form when submitted or do I get errors. Please review the script and let me know if BORU allows PHP Mail () and if there is an issue with the server at present.

Also, the script is lying in the root folder (FYI).

PHP:
<?php 

$EmailFrom = "form@shapariya.com";
$EmailTo = "sshapariya@gmail.com";
$Name = Trim(stripslashes($_POST['name']));
$Email = Trim(stripslashes($_POST['email'])); 
$Message = Trim(stripslashes($_POST['message'])); 
$Subject = "Enquiry from $Name";

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

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$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=contact-thank-you.html\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=contact-error.html\">";
}

?>
 
Last edited:
Status
Not open for further replies.
Top