fishmaster0 Posted April 27, 2008 Share Posted April 27, 2008 I have a contact form set up and it has 11 boxes to fill out. I need all 11 responses set to my e-mail but the mail() function can only send 5. What is the best way to accomplish this procedure. I am new here and I thank you for your help Link to comment https://forums.phpfreaks.com/topic/103139-solved-mail-will-only-e-mail-5-thing-i-need-more/ Share on other sites More sharing options...
AndyB Posted April 27, 2008 Share Posted April 27, 2008 the mail() function will send as much as you want. Sounds like there's a problem with your form code, where you have different inputs having the same name. In the absence of relevant code, anything else requires a crystal ball. Post relevant parts of your problem code. Link to comment https://forums.phpfreaks.com/topic/103139-solved-mail-will-only-e-mail-5-thing-i-need-more/#findComment-528300 Share on other sites More sharing options...
fishmaster0 Posted April 27, 2008 Author Share Posted April 27, 2008 this is the code that is in a sendeail.php it is what sends the e-mail to me <?php $ip = $_POST['ip']; $httpref = $_POST['httpref']; $httpagent = $_POST['httpagent']; $visitor = $_POST['visitor']; $lastName = $_POST['lastName']; $visitormail = $_POST['visitormail']; $phoneNum = $_POST['phoneNum']; $arrival = $_POST['arrival']; $departure = $_POST['departure']; $total = $_POST['total']; $kids = $_POST['kids']; $notes = $_POST['notes']; $attn = $_POST['attn']; if (eregi('http:', $notes)) { die ("Do NOT try that! ! "); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($visitor) || empty($visitormail) || empty($notes )) { echo "<h2>Use Back - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $attn = $attn ; $subject = $attn; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Attention: $attn \n Message: $notes \n From: $visitor ($visitormail)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $visitormail\r\n"; mail("[email protected]", $from, $message, $visitor, $lastName, $phoneNum); ?> Link to comment https://forums.phpfreaks.com/topic/103139-solved-mail-will-only-e-mail-5-thing-i-need-more/#findComment-528310 Share on other sites More sharing options...
kenrbnsn Posted April 27, 2008 Share Posted April 27, 2008 The format of the mail() function is <?php mail($to,$subject,$message,$headers,$options); ?> Please read the fine manual Ken Link to comment https://forums.phpfreaks.com/topic/103139-solved-mail-will-only-e-mail-5-thing-i-need-more/#findComment-528320 Share on other sites More sharing options...
Fadion Posted April 27, 2008 Share Posted April 27, 2008 Ure using mail() the wrong way: mail("[email protected]", $from, $message, $visitor, $lastName, $phoneNum); U cant assign random variables to act like headers, as the syntax of mail is: bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) U have to concatenate all the input fields data to the $message variable: <?php $to = '[email protected]'; //the subject $subject = 'Mail from the website'; //construct the mail message $message = 'Lastname: ' . $_POST['lastName'] . "\n"; $message .= 'Visitor: ' . $_POST['visitor'] . "\n"; $message .= 'Total: ' . $_POST['total'] . "\n"; //construct also the additional headers $headers = 'From: ' . $visitor . ' <' . $visitormail . "> \r\n"; $headers .= 'Reply-To: ' . $visitor . ' <' . $visitormail . "> \r\n"; $headers .= 'X-Mailer: PHP/' . phpversion(); //this is the correct way of using mail() mail($to, $subject, $message, $headers); ?> Link to comment https://forums.phpfreaks.com/topic/103139-solved-mail-will-only-e-mail-5-thing-i-need-more/#findComment-528323 Share on other sites More sharing options...
fishmaster0 Posted April 27, 2008 Author Share Posted April 27, 2008 I thank you all for your quick responses but obviously I am not the best at php. So I don't think I really understand. What would be he best way for me to send the form that people are filling out. Or maybe you could point me somewhere that has this already answered. Link to comment https://forums.phpfreaks.com/topic/103139-solved-mail-will-only-e-mail-5-thing-i-need-more/#findComment-528331 Share on other sites More sharing options...
Fadion Posted April 27, 2008 Share Posted April 27, 2008 The example i gave or those pretty similiar found at php.net are basic structure of an email message. Assign $_POST variables to your variables, like u did in the code and construct the $message string the way u want the message to be sent. In the example i gave, the message body would be like: Lastname: Smith Visitor: John Total: $1300 Link to comment https://forums.phpfreaks.com/topic/103139-solved-mail-will-only-e-mail-5-thing-i-need-more/#findComment-528336 Share on other sites More sharing options...
fishmaster0 Posted April 27, 2008 Author Share Posted April 27, 2008 I got it thank you very much!!!! ;D Link to comment https://forums.phpfreaks.com/topic/103139-solved-mail-will-only-e-mail-5-thing-i-need-more/#findComment-528360 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.