newbie mail function syntax question


#1

Hello,

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("myemail@email.net","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("myemail@email.net","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.

#2

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

[php]<?
$smessage = stripslashes($message);

mail("myemail@email.net",“Subject”,“From $name,$smessage”,“From: $emailnr”);
?>[/php]

Try that and see how it goes.


#3

Thanks a bunch! That did it.

-Jordan