I have a form on my website that is working apart from the textarea data not being sent in the email. The form lets people enter name, email and a message. I receive the email and I get the name and email, but the "message" area is blank.
I have even tried to change the textarea to an input field but not even this is sent in the email? I have no idea why this is not working. Can anyone please help.
Below is HTML form code as well as PHP mail.
HTML
<form enctype="multipart/form-data" method="post" action="php/mail.php" name="cform" id="cform">
<input name="name" id="name" type="text" class="col-xs-12 col-sm-6 col-md-6 col-lg-6" placeholder="Your name..." >
<input name="email" id="email" type="email" class="col-xs-12 col-sm-6 col-md-6 col-lg-6 noMarr" placeholder="Your email..." >
<textarea name="message" id="message" type="text" cols="40" rows="5" class="col-xs-12 col-sm-12 col-md-12 col-lg-12" placeholder="Your message..."></textarea>
<input type="submit" id="submit" name="send" class="submitBnt" value="Send Message">
</form>
PHP
<?
require("class.phpmailer.php");
// form validation vars
$formok = true;
$errors = array();
// sumbission data
$ipaddress = $_SERVER['REMOTE_ADDR'];
$date = date('d/m/Y');
$time = date('H:i:s');
// form data
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP - mail or smtp.domain.com
$mail->Host = "myserver"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "myUsername"; // SMTP username
$mail->Password = "myPassword"; // SMTP password
$mail->From = "myEmail@Address.com"; // SMTP username
$mail->AddAddress("myEmail@Address.com"); // Your Adress
$mail->Subject = "New contact request from My Website !";
$mail->IsHTML(true);
$mail->CharSet = 'UTF-8';
$mail->Body = "<p>You have recieved a new message from the enquiries form on your website.</p>
<p>
<strong>Name: </strong>{$name}
</p>
<p>
<strong>Email Address: </strong>{$email}
</p>
<p>
<strong>Message: </strong>{$message} // NOT WORKING HERE
</p>
<p>
This message was sent from the IP Address: {$ipaddress} on {$date} at {$time}
</p>";
if(!$mail->Send())
{
echo "There was an error... unable to send email <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Thank you. Your email has been sent.";
?>