NickG21 Posted January 10, 2007 Share Posted January 10, 2007 hey everyone, i am trying to write a small validation script of some information on a single form page and at the end of the validation if everything is correct mail ALL of the entered information to myself. my quick mail statement looks like this:[CODE] mail('[email protected]',$subject, $problem,"From: $name <$email>");[/CODE]but i am unable to send the other variables that are passed from the form into the session because there are only 8 parameters allowed in mail();. i am new to this as you can probably tell and was wondering if i could take the other 5 or 6 variables i pass into validation and make them be the body of the mail?any help is appreciated Link to comment https://forums.phpfreaks.com/topic/33591-basic-mailing/ Share on other sites More sharing options...
HuggieBear Posted January 10, 2007 Share Posted January 10, 2007 Yes, you just need to include them in the body, like this:[code]<?php// Here's the values from my form$fav_colour = $_POST['colour'];$fav_food = $_POST['food'];$fav_animal = $_POST['animal'];// Here's the to and subject fields$to = "[email protected]";$subject = "My Test Email";// Here's the values from my form all combined into one message variable$msg .= "My favourite colour is $fav_colour\n";$msg .= "My favourite food is $fav_food\n";$msg .= "My favourite animal is $fav_animal\n";// Send the messagemail($to, $subject, $msg);?>[/code]RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/33591-basic-mailing/#findComment-157366 Share on other sites More sharing options...
NickG21 Posted January 10, 2007 Author Share Posted January 10, 2007 thank you Link to comment https://forums.phpfreaks.com/topic/33591-basic-mailing/#findComment-157367 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.