jlavik Posted March 18, 2009 Share Posted March 18, 2009 I'm confused. I've got code that involves 6 files in all, much of it from a free script I got somewhere. The part that's failing (surprise surprise) is my own code, but it works beautifully on my own host site, where I was testing it. When I moved it to my client's host server, everything works except my attempt to send a followup email. I've narrowed it down to the user's email address. If I substitute an actual address for my variable, the whole process succeeds. Here's the relevant portion that isn't working on one server but succeeds on another (if you want it all, I'd be happy to provide it): from a file called poll_vote.php: Please enter your email address... <form action="gift.php" method="post" enctype="multipart/form-data"> <label for="addr">Email:</label> <br> <input type="text" name="my_addr" id="my_addr"> <p> <br /> <input type="submit" name="submit" value="Submit" /> </form> and the file gift.php: <?php $to = $my_addr; $subject = "Thank You for your feedback!"; $message = "Thank you for providing feedback. I sincerely appreciate every opinion.\r\n\r\nI'd like to take this opportunity to remind you that I am offering half-hour phone sessions at the special low rate of $25 for a limited time. Please email today to schedule your appointment.\r\n\r\nBest regards,\r\nMelannie"; $from = "[email protected]"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent.<br>"; ?> Working example: http://www.bwomdesign.com/melannie/contact.php Failing example: http://www.melannie-insights.com/contact.php Link to comment https://forums.phpfreaks.com/topic/150053-solved-so-new-it-hurts-ouch/ Share on other sites More sharing options...
trq Posted March 18, 2009 Share Posted March 18, 2009 Change.... $to = $my_addr; to $to = $_POST['my_addr']; Link to comment https://forums.phpfreaks.com/topic/150053-solved-so-new-it-hurts-ouch/#findComment-788047 Share on other sites More sharing options...
trq Posted March 18, 2009 Share Posted March 18, 2009 Change.... $to = $my_addr; to $to = $_POST['my_addr']; Seems your testing host is out of date / poorly configured. Link to comment https://forums.phpfreaks.com/topic/150053-solved-so-new-it-hurts-ouch/#findComment-788049 Share on other sites More sharing options...
jlavik Posted March 18, 2009 Author Share Posted March 18, 2009 Thanks for the speedy reply. Unfortunately, I'm still seeing the same results. Works in the test environment but not the other. Link to comment https://forums.phpfreaks.com/topic/150053-solved-so-new-it-hurts-ouch/#findComment-788062 Share on other sites More sharing options...
trq Posted March 18, 2009 Share Posted March 18, 2009 Sorry, you'll also want to remove the enctype definition from your form. Link to comment https://forums.phpfreaks.com/topic/150053-solved-so-new-it-hurts-ouch/#findComment-788074 Share on other sites More sharing options...
jlavik Posted March 18, 2009 Author Share Posted March 18, 2009 It works! It works! Doing the happy dance!!! Thorpe, you are my hero. I worship at your feet. Link to comment https://forums.phpfreaks.com/topic/150053-solved-so-new-it-hurts-ouch/#findComment-788098 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.