Email Contact form CODE // please help

Hi everyone.

Pretty desperate, first time that I’m working with php. Learning this language, makes sense, however I can’t figure out why my code is not working.

Emails are not coming in at all. Additional required info (phone number, first name, last name) should be included in the message.

Please help. Thank you everyone.

<?php $to = "[email protected]"; $subject = "From Website Contact Form"; $first = $_REQUEST['first']; $last = $_REQUEST['last']; $email = $_REQUEST['email']; $phone = $_REQUEST['phone']; $MESSAGE_BODY = "Name: " . $_POST["first"] . "\n"; $MESSAGE_BODY = "Name: " . $_POST["last"] . "\n"; $MESSAGE_BODY = "Contact No: " . $_POST["phone"] . "\n"; $MESSAGE_BODY = "Email: " . $_POST["email"] . "\n"; $MESSAGE_BODY = "Requirement: " . nl2br($_POST["message"]) . "\n"; $message = $_REQUEST['message' + 'email' + 'first' + 'last']; $from = $_REQUEST['email']; $headers = "From:" . $from; mail($to, $subject, $MESSAGE_BODY, $headers); echo "Your message has been sent"; ?>

First thing is, are you on a server or localhost. The mail function uses the default mail server, which has to be setup in order to use. Barring that, have you checked your junk mail folder? Programmatic emails tend to land there based on past experience.

Sponsor our Newsletter | Privacy Policy | Terms of Service