koolaid Posted October 18, 2007 Share Posted October 18, 2007 ??? let me start by saying thank you, and that i am php stupid. I have made php mail work a couple times before, but this time i want my script to send mail to an address that the user inputs. What's wrong with what i am doing? <?php $sendTo = .$_POST["email"]; $sendTo2 ="mattpaxton@clearchannel.com"; $subject = "* listing *"; $headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " "mattpaxton@clearchannel.com" $message = $_POST["phone"] . $_POST["message"]; mail($sendTo, $subject, $message, $headers); mail($sendTo2, $subject, $message, $headers); ?> Quote Link to comment https://forums.phpfreaks.com/topic/73858-solved-php-mail-not-working/ Share on other sites More sharing options...
BlueSkyIS Posted October 18, 2007 Share Posted October 18, 2007 is there really a dot before $_POST["email"]? $sendTo = .$_POST["email"]; Quote Link to comment https://forums.phpfreaks.com/topic/73858-solved-php-mail-not-working/#findComment-372615 Share on other sites More sharing options...
koolaid Posted October 18, 2007 Author Share Posted October 18, 2007 I tried it w/ and w/o neither way works, and i really have no idea what i am doing. I am an Action Script developer Quote Link to comment https://forums.phpfreaks.com/topic/73858-solved-php-mail-not-working/#findComment-372629 Share on other sites More sharing options...
BlueSkyIS Posted October 18, 2007 Share Posted October 18, 2007 yes, this code shouldn't even compile. if you aren't seeing errors, you probably have error reporting turned off. you may need to add this at the top of your script: ini_set("error_reporting","E_ALL"); Quote Link to comment https://forums.phpfreaks.com/topic/73858-solved-php-mail-not-working/#findComment-372631 Share on other sites More sharing options...
koolaid Posted October 18, 2007 Author Share Posted October 18, 2007 I put that code in. I normally would not post in forums when i am this bad at what i am doing. I ordered a couple books so that i may learn the correct way of structuring my code "Foundation PHP 5 for Flash "PHP Solutions: Dynamic Web Design Made Easy (Solutions)" but i can not wait until they get here. This is the last hurtle i have for this project, and then i will be able to actually learn before i am expected to Implement. I know my code is screwed, but can you tell me where i am going wrong? Quote Link to comment https://forums.phpfreaks.com/topic/73858-solved-php-mail-not-working/#findComment-372638 Share on other sites More sharing options...
BlueSkyIS Posted October 18, 2007 Share Posted October 18, 2007 this might be right. and mattpaxton@clearchannel.com is probably going to receive an email from my computer. <?php $sendTo = $_POST["email"]; $sendTo2 ="mattpaxton@clearchannel.com"; $subject = "* listing *"; $headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: mattpaxton@clearchannel.com\r\n"; $message = $_POST["phone"] . $_POST["message"]; mail($sendTo, $subject, $message, $headers); mail($sendTo2, $subject, $message, $headers); ?> Quote Link to comment https://forums.phpfreaks.com/topic/73858-solved-php-mail-not-working/#findComment-372640 Share on other sites More sharing options...
koolaid Posted October 18, 2007 Author Share Posted October 18, 2007 That did it! Thanks a lot i know it can be frustrating helping people who are completely clueless and unwilling to learn on their own. I assure you if i had any more time i would have made a greater effort to learn on my own. Thanks again man. Quote Link to comment https://forums.phpfreaks.com/topic/73858-solved-php-mail-not-working/#findComment-372645 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.