cmgweb Posted May 9, 2012 Share Posted May 9, 2012 I have the code echoing into the next page where it says your mail was sent successfully but it wont email me all the variables here is the code: <!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Submitted Form</title> </head> <body> <?php session_start(); echo "<html> <head><title>Posted Variables</title></head> <body>"; $to = "[email protected]"; $subject = "SCE SONGS ORDER FORM"; $email = $_REQUEST['email']; foreach ($_POST as $field => $value) { echo "$field = $value<br>"; } $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "Your mail was sent successfully"; } else {print "We encountered an error sending your mail"; } ?> </body> </html> please help me out if you need anything else just ask....my email is [email protected] Quote Link to comment https://forums.phpfreaks.com/topic/262323-php-wont-email-my-form/ Share on other sites More sharing options...
cmgweb Posted May 9, 2012 Author Share Posted May 9, 2012 the actual site in use is calmktg.com/songs if you need to see the html markup Quote Link to comment https://forums.phpfreaks.com/topic/262323-php-wont-email-my-form/#findComment-1344344 Share on other sites More sharing options...
ocpaul20 Posted May 11, 2012 Share Posted May 11, 2012 forget about mailing the email. first of all get the variables displayed on the page, then tackle the email part. Later, the email part can be checked from the command line to make sure that is actually getting out. Quote Link to comment https://forums.phpfreaks.com/topic/262323-php-wont-email-my-form/#findComment-1344690 Share on other sites More sharing options...
Drummin Posted May 11, 2012 Share Posted May 11, 2012 <?php session_start(); echo "<html> <head><title>Posted Variables</title></head> <body>"; $to = "[email protected]"; $subject = "SCE SONGS ORDER FORM"; $email = $_REQUEST['email']; $message=""; foreach ($_POST as $field => $value) { $message .="$field = $value<br>"; } $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "Your mail was sent successfully"; } else {print "We encountered an error sending your mail"; } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/262323-php-wont-email-my-form/#findComment-1344698 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.