Hey guys, this is a really weird issue.
In my contact form I have an input field for Full Name.
In my php file, I have it set to use the Full Name field for the From part of the headers, but the form ONLY sends an email when one word is inputted into the field. If someone inputs their full name (2 or more words), the form will not send the email.
Any idea why it would do that?
Here's my code:
PHP Code:
//send the email
$body = $_POST['full_name'] . " sent you the following message via contact form.<br/>\n\n";
$body .= "<br/><strong>Email Address:</strong>\n" . $_POST['email_address'];
$body .= "<br/><strong>Message: </strong>\n\n" . $_POST['input_msg'];
$to = "myemail@gmail.com";
$subject = "Contact Form";
$from = 'MIME-Version: 1.0' . "\r\n";
$from .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$from .= "From: " . $_POST['full_name'] . "\r\nReply-To: " . $_POST['email_address'] . "\r\nBcc: myemail@gmail.com";
mail($to, $subject, $body, $from);