PDA

Click to See Complete Forum and Search --> : contact form issues


deviled egg
04-01-2008, 09:43 PM
can someone please take a look at this code and tell me why the email contact form is not working? <?php

$field1 = $_POST['name'];
$field3 = $_POST['email'];
$field3 = $_POST['message'];

$EmailTo = "racingdominic@yahoo.com";
//$EmailTo = "joe@icrlogix.com";
$EmailFrom = "web@dominictherrien.com";
$Subject = "Message from Dominic Web Site";

// prepare email body text
$Body = "";

$Body .= "Name: ";
$Body .= $field1;
$Body .= "\n";
$Body .= "
E-Mail: ";
$Body .= $field2;
$Body .= "\n";
$Body .= "
Message: ";
$Body .= $field3 ;
$Body .= "\n";


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

?>

the site is http://dominictherrien.com/email.html Any help is appreciated, thank you!!:)

Drazan
04-02-2008, 01:09 AM
If you don't use any validation in that form you are opening yourself up to spammers to use that form to send thousands of emails from your server.

Heck, I had a validated form before and still they were able to send out spam.

So my latest recommendation is dd-formmailer. Free, moderately easy to set up. And works like a charm so far. recaptcha is also an option to use.

http://www.dagondesign.com/articles/secure-php-form-mailer-script/