Syntax is not correct in this line. where is my mistake?:
[php] $sent = mail($to, $subject.$name,$phone.$message.$email); [/php]
Syntax is not correct in this line. where is my mistake?:
[php] $sent = mail($to, $subject.$name,$phone.$message.$email); [/php]
Syntax in this particular line seem to be correct - 3 string parameters passed to the mail() function.
If you’re getting an error message, check your code above this line… it is likely you’re missing semicolon or something else.
The syntex is not correct, there’s to many variables. Name and that stuff would go in the message, not in the function.
The syntax is fine. It’s more like he’s trying to put the name in the subject so the error definitely isn’t that line.
Yes it is, to many parameters. all that should be there is to from, subject, message, and headers. phone should not be there and he’s got periods instead of commas in there
$sent = mail($to, $subject.$name,$phone.$message.$email); should be
[php]
$message = $name.", ".$phone;
$sent = mail($email, $from, $subject, $message, $headers); // assuming $email is the user’s email[/php]
you can find search google for header examples.
He is using 3 parameters in his call to mail() function (notice he concatenate some of variables with dot operator . ). So, basically he is using this syntax:
[php]mail ($to, $subject, $body);[/php]
and this is correct syntax of php mail() function.
The parameter $from what you mentioned in your post above should be passed using optional 4th parameter - email headers.