Assistance with PHP Code?

Hi all! Working on creating a contact form that sends e-mail to an e-mail address. I'm THIS close to perfection, however, I notice that not all of the data is being captured. All it captures is the e-mail address & the message itself. Not the "name" field or the drop-down data. Any changes I make only results in the e-mail being considered spam. Here is my code: Any changes I make only results in the e-mail being considered spam. Please help!

Apr 2, 2025 - 02:12
 0
Assistance with PHP Code?

Hi all!

Working on creating a contact form that sends e-mail to an e-mail address. I'm THIS close to perfection, however, I notice that not all of the data is being captured.

All it captures is the e-mail address & the message itself. Not the "name" field or the drop-down data.

Any changes I make only results in the e-mail being considered spam.

Here is my code:

if ($_SERVER["REQUEST_METHOD"] == "POST") {
$to = "myemail@example.com";
$subject = "Contact Form Submission";
$message = htmlspecialchars($_POST['message']);
$headers = "From: " . htmlspecialchars($_POST['email']);

mail($to, $subject, $message, $headers);

}
?>

Any changes I make only results in the e-mail being considered spam.

Please help!