newbie mail function syntax question



So this is my very first attempt at using the mail function. I’ve messed something up and I can’t figure it out. I have a form with name, email and message fields. Here is my code which returns a parse error on line 6-

<?php $smessage = stripslashes($message); mail("","Subject", From $name,$smessage," "From: $emailnr"); There is more code, but this is the problematic part. What's wrong up there? I have this code- <?php $smessage = stripslashes($message); mail("","Subject",$smessage, "From: $emailnr"); Which does work. All I'm trying to do in the top example is add the name field of my form to the $message I get back. Thanks for any help.


Well, if you copied and pasted the code then I notice you are missing your double qoutes.

$smessage = stripslashes($message);

mail("",“Subject”,“From $name,$smessage”,“From: $emailnr”);

Try that and see how it goes.


Thanks a bunch! That did it.