freenity Posted January 29, 2008 Share Posted January 29, 2008 Hi guys And again I'm opening one of the greatest mysteries in the world: how make the mail() function work with hotmail. I already have a function that sends mails with headers and stuff and it works great with gmail, yahoo, etc AND it worked fine with hotmail just about 6 months ago... now it doesn't. The mails doesn't even go to the spam box. Anyone could solve this?? I can post my code if it will help... Thanks for any advise. Quote Link to comment https://forums.phpfreaks.com/topic/88424-solved-php-mail-and-hotmail/ Share on other sites More sharing options...
trq Posted January 29, 2008 Share Posted January 29, 2008 This is likely a server config issue, nothing to do with php. Usually relating to your servers certificates. Quote Link to comment https://forums.phpfreaks.com/topic/88424-solved-php-mail-and-hotmail/#findComment-452538 Share on other sites More sharing options...
freenity Posted January 29, 2008 Author Share Posted January 29, 2008 Do you think there is some edit needed in the php.ini ?? Quote Link to comment https://forums.phpfreaks.com/topic/88424-solved-php-mail-and-hotmail/#findComment-452588 Share on other sites More sharing options...
kenrbnsn Posted January 29, 2008 Share Posted January 29, 2008 You probably need a "SPF" record in your DNS. If you don't know how to add on, ask your hosting company. Ken Quote Link to comment https://forums.phpfreaks.com/topic/88424-solved-php-mail-and-hotmail/#findComment-452627 Share on other sites More sharing options...
freenity Posted January 29, 2008 Author Share Posted January 29, 2008 hi, thanks for the reply. I was looking at the phpbb3 send mail class and I managed to extract how it makes the headers. Now it seems to work fine (the mail arrives, but to the spam box, anyway it isnt so important as the emails from phpbb3 arrive into spam box too), the real problem is that the body of the message isn't shown. Here is the code I use: sendmail('anotheremail@hotmail.com','myemail@gmail.com','subject','hi how are you?'); function sendmail($to, $from, $subject, $msg) { $headers = array(); $headers[] = 'From: ' . $from; $headers[] = 'Reply-To: ' . $from; $headers[] = 'Return-Path: <hosting@hosting.com>'; $headers[] = 'Sender: <hosting@hosting.com>'; $headers[] = 'MIME-Version: 1.0'; $headers[] = 'Message-ID: <' . md5(time()) . '@hosting.com>'; $headers[] = 'Date: ' . date('r', time()); $headers[] = 'Content-Type: text/plain; charset=UTF-8'; $headers[] = 'Content-Transfer-Encoding: 8bit'; $headers[] = 'X-Priority: 3'; $headers[] = 'X-MSMail-Priority: Normal'; $headers[] = 'X-Mailer: FT'; $headers[] = 'X-MimeOLE: FT'; $headers[] = 'X-phpBB-Origin: ' . 'http://hosting.com'; $headers = implode("\n",$headers); if (mail($to, $subject, $msg, $headers)) return TRUE; else return FALSE; } Would apreciate if someone code help with an advise. hosting.com is replaced with my domain.. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/88424-solved-php-mail-and-hotmail/#findComment-452929 Share on other sites More sharing options...
freenity Posted January 30, 2008 Author Share Posted January 30, 2008 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/88424-solved-php-mail-and-hotmail/#findComment-453352 Share on other sites More sharing options...
freenity Posted January 30, 2008 Author Share Posted January 30, 2008 SOLVED That script works just fine. It was a problem with hotmail, that it doesnt show the message body if the email is in the spam box =), Just had to click on 'mark safe' and it showed out. Thanks for the replies. Quote Link to comment https://forums.phpfreaks.com/topic/88424-solved-php-mail-and-hotmail/#findComment-453921 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.