Hi, I have the following script, which works great: <?php // The message $message = "Catalog Request\nLine2here\nLine3here"; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail('adamjthompson@earthlink.net', 'Catalog Request', $message); ?> Code (markup): Here's what I can't figure out how to do. I'm going to have a form submitting (POST) to this script. I want to take the form input and put it into the email message. I tried using this in place of the line 2 above, but it didn't work: echo $_POST["firstname"]; Code (markup): How should I do this? Thanks! Adam
to echo a var simply escape the echo echo "Hello ".$name." How are you?"; so in the echo use ". to start the var and ." to end.
Thank you! I ended up with the following, which works great! <?php // The message $message = "Catalog Request\n".$_POST["firstname"]."\n".$_POST["lastname"]."\n".$_POST["address"]."\n".$_POST["city"]."\n".$_POST["state"]."\n".$_POST["zip"]."\n".$_POST["phone"]."\n".$_POST["email"].""; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail('adamjthompson@earthlink.net', 'Catalog Request', $message); ?> <html> <head> <title>Thank You</title> </head> <body> Thank You! </body> </html> Code (markup):