daddydanimal
New Member
I'm really struggling to find a way to send checklist data to an email, let alone a user input email! I have tried following and applying the answers from other similar questions asked but still to no avail.This is my PHP so far, although I am quite confused.\[code\]<?php //Check for POSTif (isset($_REQUEST['email'])){//All your inputs$expecting = array('checkbox1','checkbox2','checkbox3','checkbox4' ,'checkbox5');//Start building your email$email_content = '';foreach($expecting as $input){ //Is checkbox? if(substr($input,0,8)=='checkbox'){ $email_content .= ucfirst($input).':'.(isset($_POST[$input]) && $_POST[$input] == 'on' ? 'True' : 'False'.'<br />'); }else{ $email_content .= ucfirst($input).':'.(!empty($_POST[$input]) ? $_POST[$input] : 'Unknown').'<br />'; }}print_r($email_content);if(mail('$email', 'packing list', wordwrap($email_content))){ //mail sent}else{ //mail failed 2 send}}?>\[/code\]And this is my HTML\[code\] <form name="emailform" method="post" action="send-list.php"> <div data-role="fieldcontain"> <label for='name'><h3>Festival name:</h3> </label> <input type="text" name="name"> <h3>Essentials</h3><fieldset data-role="controlgroup" data-type="vertical"><legend></legend><input name="checkbox1" id="checkbox1" type="checkbox" /><label for="checkbox1">Tickets</label><input name="checkbox2" id="checkbox2" type="checkbox" /><label for="checkbox2">Parking pass</label><input name="checkbox3" id="checkbox3" type="checkbox" /><label for="checkbox3">Directions</label><input name="checkbox4" id="checkbox4" type="checkbox" /><label for="checkbox4">Cash & Cards</label><input name="checkbox5" id="checkbox5" type="checkbox" /><label for="checkbox5">Keys</label></fieldset>Email: <input name='email' type='text'><br><input type="submit" value="http://stackoverflow.com/questions/14566486/Send">\[/code\]I would be happy if I could just get the checked boxes to send to an email and from there, I would hopefully be able to work out how to send the information to a user input email.