here is the html <form method="post" action="mes.php" name="form"> <table> <tr><td>First Name: </td><td><input type="text" name="fname" /></td></tr> <tr><td>Last Name: </td><td><input type="text" name="lname" /></td></tr> <tr><td>E-Mail: </td><td><input type="text" name="email" /></td></tr> <tr><td>Message: </td><td><textarea name="tmessage" col="10" rows="4"></textarea></td></tr> <tr><td>Type of Message: </td><td> <input type="radio" name="mtype" value="prayer" checked="checked"> Prayer Request <br/> <input type="radio" name="mtype" value="message"> Message</td></tr> <tr><td></td><td><input type="submit" name="submit" value="Send Message" /></td></tr> </table> </form> Code (markup): here is the php <?PHP $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $tmessage = $_POST['tmessage']; $mtype = $_POST['mtype']; mail('info@findnewlife.com', $mytype . ' for NewLife', $tmessage); ?> Code (markup): its just sending the Message part nothing else thanks for the help
Well, it's because you only send the Message part! You need to include headers: $headers = "From: $fname <$email>\n"; mail('info@findnewlife.com', $mytype . ' for NewLife', $tmessage, $headers); PHP: Or you could include that data into your message..
Yes if you add it $headers = "From: $fname $lname <$email>\n"; mail('info@findnewlife.com', $mytype . ' for NewLife', $tmessage, $headers);
how do i make it show up in the email and is there a way to make the title of the message one of the 2 thing you can pick on the menu Prayer Request or Message
Change <tr><td>Type of Message: </td><td> <input type="radio" name="mtype" value="prayer" checked="checked"> Prayer Request <br/> <input type="radio" name="mtype" value="message"> Message</td></tr> HTML: to <tr><td>Type of Message: </td><td> <input type="radio" name="mtype" value="Prayer Request" checked="checked"> Prayer Request <br/> <input type="radio" name="mtype" value="Message"> Message</td></tr> HTML: <?PHP $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $tmessage = $_POST['tmessage']; $mtype = $_POST['mtype']; $headers = "From: $fname $lname <$email>\n"; mail('info@findnewlife.com', $mytype . ' for NewLife', 'Name: ' . $fname . ' ' . $lname . '\nEmail: ' .$email. '\nMessage: ' . $tmessage, $headers); ?> PHP:
mail($to, $MySubject, $MyMessage, $from); Just create the variables to what you want. $MySubject = stripslashes($_POST[Subject]);