PHP form sends email but doesn't capture form data

Need help :frowning:

I don’t really know what I’m doing and if someone could offer their advice I would be eternally grateful!

Basically, my form is sending but I only receive the subject line, and none of the information from the form. Plus it doesn’t appear to be coming from the “from” address.

Here is my form and process.php file:

Your name:
E-mail address:
Contact No:


<?PHP $email = $_POST["emailaddress"]; $to = "[email protected]"; $subject = "New Email Address for Mailing List"; $headers = "From: $email\n"; $message = "A visitor to your site has sent the following email address to be added to your mailing list.\n Email Address: $email"; $user = "$email"; $usersubject = "Thank You"; $userheaders = "From: [email protected]\n"; $usermessage = "Thank you for subscribing to our mailing list."; mail($to,$subject,$message,$headers); mail($user,$usersubject,$usermessage,$userheaders); header("Location: thankyou.html"); ?>

This doesn’t match your form:

[php]$email = $_POST[“emailaddress”];[/php]

It should be

[php]$email = $_POST[“email”];[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service