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('ngirard@....com',$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 Quote 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 = "myemail@mydomain.com";$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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/33591-basic-mailing/#findComment-157367 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.