I simply want the message from my contact form to be sent to whoever is chosen in the drop down selection on the form page. And if possible, is there a simple way to add spam prevention? Thank you!
HTML
[code]
— Send to —
person 1
person 2
person 3
PHP
[php]<?php
$name = $_POST[“name”];
$to = $_POST[“to”];
$from = $_POST[“email”];
$message = $_POST[“message”];
$email_from = $email;
$subject = “New message from” . $from;
mail($to,$subject,$message,$from);
echo ‘
Your message has been sent.
’;?>[/php]
I would also like the email to be formatted like the following:
Subject: New Message from $name
Name: John Doe
Email: [email protected]
Message: I like your website.