I am trying to send some basic text data from a html form to an email. I found an article online with the php code contain below. Here is the link to the article https://html.form.guide/email-form/php-form-to-email/. I am using easyphp dev server to run my code and it is reporting an error on line 22 of the php file. Here is the error:
Parse error: syntax error, unexpected 'mail' (T_STRING) in C:\Program Files (x86)\EasyPHP-Devserver-17\eds-www\form-to-email.php on line 22.
Any help in clarifying what this means would be greatly appreciated as this is my first time attempting this. Thanks in advance.
<?php
$name = $_POST['name'];
$visitor_email = $_POST['email'];
$message = $_POST['message'];
$email_from = 'exampleemail@example.com';
$email_subject = "New Form submission";
$email_body = "You have received a new message from the user $name.\n".
"Here is the message:\n $message".
$to = "exampleemail@example.com";
$headers = "From: $email_from \r\n";
$headers .= "Reply-To: $visitor_email \r\n";
ini_set(25)
mail($to,$email_subject, $email_body,$headers);
?>