I have a form that dumps to a PHP page and I would like the information that the user submits with the form to be emailed using the mail() function.
I've tried several things, and everything about the things I've tried works, except getting the variables into the message body. Any ideas?
Thanks,
Michael
what exactly have you tried? how about concatenating the variables into your message body...
$var1 = $POST['var1']; $var2 = $POST['var2'];
$msgBody = "Hello, ".$var1.". Your ".$var2." is completed.";
mail(blah, blah, $msgBody);
I had tried what you suggested, but evidently I was using single (') instead of double (") quotations on my variable. I didn't realize it would be that simple, I had been trying to figure out how to work with arrays, etc. Thanks for your help, I'm new to all of this...
I don't quite understand what this means: "I was using single (') instead of double (") quotations on my variable"
just a suggestion, read this: http://www.php.net/manual/en/language.variables.php
i.e., I was using:
$msg = '$var1, n\$var2, ...'
changing to
$msg = "$var1,n\$var2,..."
resolved the problem. oh, and thanks for the tip on variable syntax