Simple Contact Form Problem!?!

Im making a simple submit form. When the email sends I get a blank email. Can someone see the problem?

[php]<?php
$action=$_REQUEST[‘action’];
if ($action=="") /* display the contact form /
{
?>


First Name:



Last Name:



Email Address:



Verify Email:





<?php
}
else /
send the submitted data */
{
$fname=$_REQUEST[‘fname’];
$lname=$_REQUEST[‘lname’];
$email=$_REQUEST[‘email’];
$vemail=$_REQUEST[‘vemail’];

if (($fname=="")||($lname=="")||($email=="")|| ($vemail==""))
    {
    echo "All fields are required, please fill <a href=\"\">the form</a> again.";
    }
else{        
    $from="From: $name<$email>\r\nReturn-path: $email";
    $subject="Message sent using your contact form";
    mail("@.com", $subject, $fname, $lname, $email, $vemail, $from);
    echo "Email sent!";
    }
}  

?>

[/php]

You’re using the mail function wrong.

Read up on the function here:

http://php.net/manual/en/function.mail.php

[php]bool mail (string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )[/php]

This is what your passing in, it doesn’t look right to me.

[php]mail("@.com", $subject, $fname, $lname, $email, $vemail, $from);[/php]

Thank you.

Sponsor our Newsletter | Privacy Policy | Terms of Service