Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

PHP Erro showing up "unexpected 'mail' "

Hey guys im so new to PHP and im still learing i made small website and made a conatct form and i need to get that infromation to my email I watched some you tube tutorials and did some coding and some erro is showng up.plz help me out………

( ! ) Parse error: syntax error, unexpected ‘mail’ (T_STRING) in C:\wampp\www\contact\contact.php on line 21

<?php
if (isset($_POST['submit'])){
$to='w.anjanadep@gmail.com';
$subject ="Message from Astaqua.com";
$from = $_POST['email'];
$name=$_POST['name'];
$subject=$_POST['subject'];
$phone=$_POST['Phone'];
$message=$_POST['message'];


$message='name:'.$_POST['name'].'<br>'.
         'subject:'.$_POST['subject'].'<br>'.
         'Phone:'.$_POST['Phone'].'<br>'.
         'message:'.$_POST['message'];

$header ='From:{$email}\r\n'.
'Cc:astaquag@gmail.com\r\n'.
'Content-Type:text/html;'

mail=($to,$subject,$message, $header);
}
>?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Mail is a function not a variable – remove the =

It should be:

mail($to,$subject,$message, $header);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading