Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Send Email form help Re: Send Email form help

#74652
cybershot
Participant

yea, get rid of the srtip_tags all together. Just try


$email = $_POST;

try it and see what happens

if that doesn’t work, I know this one does. just modify it to fit your needs

// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link

// get posted data into local variables
$EmailFrom = "your site";
$EmailTo = "Your Email Here";
$Subject = "contact form information";
$name = Trim(stripslashes($_POST));
$surname = Trim(stripslashes($_POST));
$email = Trim(stripslashes($_POST));
$city = Trim(stripslashes($_POST));
$comments= Trim(stripslashes($_POST));

// validation
$validationOK=true;
if (Trim($contactName) || Trim($surname) || Trim($contactEmail) || Trim($ContactCity) == " ")
{
$validationOK = false;
}

if (!$validationOK)
{
print "";
exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $name;
$Body .= "n";
$Body .= "Surname:";
$Body .= $surname;
$Body .= "n";
$Body .= "Email: ";
$Body .= $email;
$Body .= "n";
$Body .= "City: ";
$Body .= $city;
$Body .= "n";
$Body .= "Comments: ";
$Body .= $comments;
$Body .= "n";

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

// redirect to success page
if ($success){
print "";
}
else{
print "";
}
?>