elcash_36 Posted February 2, 2010 Share Posted February 2, 2010 Hi! Well, i have a new problem guys and i think this is the best way to solve it. I have this PHP code, it's very simple, but when i click on SEND it appears "Message sent correctly". Everything is OK. But when i enter HOTMAIL to see the e-mail sent, it doesn't appears. How could be this? This is the PHP code i'm using: <?php $Name = $_POST['Name']; $email = $_POST['email']; $Company = $_POST['Company']; $Subject = $_POST['Subject']; $header = 'From: ' . $email . " \r\n"; $header .= "X-Mailer: PHP/" . phpversion() . " \r\n"; $header .= "Mime-Version: 1.0 \r\n"; $header .= "Content-Type: text/plain"; $message = "This message was sent by " . $Name . ", from " . $Company . " \r\n"; $message .= "His e-mail is: " . $email . " \r\n"; $message .= "Subject: " . $Subject . " \r\n"; $message .= "Message: " . $_POST['message'] . " \r\n"; $message .= "Sent: " . date('d/m/Y', time()); $for = '[email protected]'; $subject = "Subject"; if (mail($for, $subject, $message, $header)) { echo("<p>Message sent correctly!</p>"); } else { echo("<p>¡ERROR! Message not sent...</p>"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/190642-email-sent-to-hotmail-doesnt-appear/ Share on other sites More sharing options...
jl5501 Posted February 2, 2010 Share Posted February 2, 2010 This is not unusual. Hotmail is a big issue to send mail to, and this is unlikely to be a PHP issue. What may help is setting up SPF records for your server, but that is way off-topic for this board. If you can send mail to other addresses then this is not a PHP issue. Quote Link to comment https://forums.phpfreaks.com/topic/190642-email-sent-to-hotmail-doesnt-appear/#findComment-1005412 Share on other sites More sharing options...
PFMaBiSmAd Posted February 2, 2010 Share Posted February 2, 2010 The From: address must be a valid email address at the sending mail server or there must be an SPF record at the domain being used in the From: address that indicates that your sending mail server is authorized to send email for that domain. Would you trust an important letter that has a From: address that says it is coming from one location but the post mark says it came from somewhere else? Quote Link to comment https://forums.phpfreaks.com/topic/190642-email-sent-to-hotmail-doesnt-appear/#findComment-1005415 Share on other sites More sharing options...
Calamity-Clare Posted February 5, 2010 Share Posted February 5, 2010 I've just posted a topic on a very similar issue. I found hotmail only has issues when you introduce headers. I'm trying to send html email, so this is an issue for me. But if you want to send just plain php mail, perhaps simply bypass the headers altogether(? - I'm aware that people are about to shoot me down about lack of standards & all that jazz, but it does fix a problem so you have to weigh the pros against the cons) Hope that helps Quote Link to comment https://forums.phpfreaks.com/topic/190642-email-sent-to-hotmail-doesnt-appear/#findComment-1007368 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.