heathergem Posted October 19, 2007 Share Posted October 19, 2007 When I use the mail function, my messages aren't arriving. As a test, I created the simplest of forms, but the email still doesn't arrive. What's wrong? Link to comment https://forums.phpfreaks.com/topic/73945-solved-mail-not-received/ Share on other sites More sharing options...
Psycho Posted October 19, 2007 Share Posted October 19, 2007 How are we suppose to know without you providing your code? Have you tried any debugging? Link to comment https://forums.phpfreaks.com/topic/73945-solved-mail-not-received/#findComment-373130 Share on other sites More sharing options...
heathergem Posted October 19, 2007 Author Share Posted October 19, 2007 Here's the code. As simple as it gets. <? $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; mail( "[email protected]", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.example.com/thankyou.html" ); ?> I haven't tried debugging. How do I do that? Link to comment https://forums.phpfreaks.com/topic/73945-solved-mail-not-received/#findComment-373135 Share on other sites More sharing options...
Wes1890 Posted October 19, 2007 Share Posted October 19, 2007 Make sure your server supports mailing... that could be a problem.. and try this too <?php $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $mail_it = mail( $email, "Feedback Form Results", $message, "From: $email" ); if (!mail_it) { // This saves to time from having to check your email/db over and over die("The mail hasnt been sent"); } else { header( "Location: http://www.example.com/thankyou.html" ); } ?> Link to comment https://forums.phpfreaks.com/topic/73945-solved-mail-not-received/#findComment-373137 Share on other sites More sharing options...
heathergem Posted October 19, 2007 Author Share Posted October 19, 2007 Make sure your server supports mailing... that could be a problem.. Yesterday it was going through just fine. Same code. I am stumped. Link to comment https://forums.phpfreaks.com/topic/73945-solved-mail-not-received/#findComment-373144 Share on other sites More sharing options...
Psycho Posted October 19, 2007 Share Posted October 19, 2007 OK, that's a bit of information you didn't provide previously. Did you try the code Wes provided? If you do not get an error then the problem is most likely external to PHP. For example the outgoing or receiving email servers may be blocking the email thinkin it is spam. Or perhaps the email client is flagging the email as spam. If that code does report the error "The mail hasnt been sent" [sic], then you need to look to the server/PHP implementation. Link to comment https://forums.phpfreaks.com/topic/73945-solved-mail-not-received/#findComment-373468 Share on other sites More sharing options...
heathergem Posted October 20, 2007 Author Share Posted October 20, 2007 Yep. The problem was external. I contacted my host and they unblocked my server. Problem solved. Thanks so much for your help! Link to comment https://forums.phpfreaks.com/topic/73945-solved-mail-not-received/#findComment-373649 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.