This code works but when i enter data with spaces in the form it does not send. new to php here how do i fix this issue.
Emailer code
<?php
if(isset($_POST['submit'])) {
$to = "[EMAIL="foxvalleysoccer@gmail.com"]foxvalleysoccer@gmail.com[/EMAIL]";
$subject = "Form Tutorial";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$postal = $_POST['postal'];
$phone = $_POST['phone'];
$rooms = $_POST['rooms'];
$address = $_POST['address'];
$body = "From: $name_field
E-Mail: $email_field
Message:
$message
Postal Code: $postal
Phone: $phone
Rooms: $rooms
Address: $address";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>