scott.russell Posted July 12, 2006 Share Posted July 12, 2006 I am trying to send an HTML email through the php mail function and all of the addresses get the mail except hotmail. Does anyone know a way to get this to work. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/ Share on other sites More sharing options...
DaveLinger Posted July 12, 2006 Share Posted July 12, 2006 probably in their spam boxes. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56856 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 It's not in there Spam boxes there not getting them at all. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56857 Share on other sites More sharing options...
akitchin Posted July 12, 2006 Share Posted July 12, 2006 then it's likely that it's being blocked from even reaching the junk box. try adding some headers such as "From: someone <somewhere@something.com>" and the reply-to header. the more legitimate headers you give your outgoing mail, the better the chance they have of reaching a user. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56867 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 These are the headers I have.$headers = "MIME-Version: 1.0\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$headers .= 'From: CHWMFL <example@example.com>' . "\r\n";$headers .= "X-Priority: 1\n";$headers .= "X-MSMail-Priority: High\n";$headers .= "X-Mailer: My mailer"; It still isnt working. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56869 Share on other sites More sharing options...
akitchin Posted July 12, 2006 Share Posted July 12, 2006 i'm going to assume that you've got example@example.com replaced with a real e-mail address. perhaps try dropping the X- headers (in particular, the priority ones) and see if they go through. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56871 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 I took out the x - headers and yes im using a real email address and it still isnt working. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56872 Share on other sites More sharing options...
kenrbnsn Posted July 12, 2006 Share Posted July 12, 2006 There is a fifth parameter to the mail() function that most people ignore. When using sendmail (or a sendmail clone), this parameter can be used to set the Return-path: header. Hotmail and some other web based email systems have been known to reject email messages where the domain name in the "From:" header is different from that in the "Return-path:" header. If you're using a shared hosting platform, this is almost always the case.To use this parameter, in your case:[code]<?php$headers = "MIME-Version: 1.0\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$headers .= 'From: CHWMFL <example@example.com>' . "\r\n";$headers .= "X-Priority: 1\n";$headers .= "X-MSMail-Priority: High\n";$headers .= "X-Mailer: My mailer"; $fifth_p = '-f example@example.com';mail($to, $subject, $body, $headers, $fifth_p);?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56876 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 $headers = "MIME-Version: 1.0\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$headers .= 'From: CHWMFL <example@example.com>' . "\r\n";$fifth_p = '-f example@example.com';This is what I currently have and it is still not sending to the hotmail account. It sends it to every other one but not to hotmail. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56880 Share on other sites More sharing options...
brown2005 Posted July 12, 2006 Share Posted July 12, 2006 the mail function works off my website to hotmail....I USE$subject = "Your login details at $config_website!";$message = "Dear $login_password_username,You will be able to login with the following information:Username: $login_password_usernamePassword: $login_password_paassword Thanks!The WebmasterThis is an automated response, please do not reply!";mail($email, $subject, $message,"From: allinthissite members<sales@allinthissite.co.uk>\n X-Mailer: PHP/" . phpversion()); Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56882 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 It still doesnt work off mine. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56885 Share on other sites More sharing options...
brown2005 Posted July 12, 2006 Share Posted July 12, 2006 send me all ur code and ill test it.. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56888 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 [code]$message = "<html> <body bgcolor='#ece9d8'> <p>Test</p> </body></html>"; $headers = "MIME-Version: 1.0\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$headers .= 'From: CHWMFL <example@example.com>' . "\r\n";$fifth_p = '-f example@example.com';$subject = "CHWMFL Scores Posted";$to = 'squall8046@hotmail.com';mail($to, $subject, $message, $headers, $fifth_p);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56892 Share on other sites More sharing options...
SharkBait Posted July 12, 2006 Share Posted July 12, 2006 One thing I have had to do was have hotmail accept the domain it was coming from.But of course you cannot tell all your users to do that. I also think its only available in their Hotmail Live version.What I am doing is relaying through our company mail system.Webserver -> MailServer -> Outside world. Our mail server might be rewriting the header so Hotmail might see it as being a spoofed address. *shrug* Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56896 Share on other sites More sharing options...
brown2005 Posted July 12, 2006 Share Posted July 12, 2006 session_start();$headers = "MIME-Version: 1.0\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$headers .= 'From: CHWMFL <example@example.com>' . "\r\n";$email = 'rberbe2002@msn.com';$subject = "CHWMFL Scores Posted";$message = "<html><body bgcolor='#ece9d8'> <p>Test</p></body></html>";mail($email, $subject, $message,"From: CHWMFL <example@example.com>\n X-Mailer: PHP/" . phpversion()); Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56898 Share on other sites More sharing options...
brown2005 Posted July 12, 2006 Share Posted July 12, 2006 try the above code mate and tell me if that works.. i got an email to my msn, but dunno about user@hotmail.com.... Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56901 Share on other sites More sharing options...
nogray Posted July 12, 2006 Share Posted July 12, 2006 Hotmail spam filter is very strict, check your spam score (using spam assassin if you have access to it). If your message is higher the 1.5 points, hotmail will block it. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56906 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 Warning: mail(): SMTP server response: 553 5.0.0 Unbalanced I got this error when I tried it. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56908 Share on other sites More sharing options...
brown2005 Posted July 12, 2006 Share Posted July 12, 2006 wat email address u trying to send to, i will check on my comp Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56909 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 Squall8046@hotmail.com Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56911 Share on other sites More sharing options...
brown2005 Posted July 12, 2006 Share Posted July 12, 2006 well ive tried it.. no messages on my comp... u get it? Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56915 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 <html><body bgcolor='#ece9d8'> <p>Test</p></body></html>Yes but it did'nt render the HTML Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56918 Share on other sites More sharing options...
brown2005 Posted July 12, 2006 Share Posted July 12, 2006 well did it go to the inbox or junk mail as junk mail makes html not work... try the new one ive just sent and put in inbox... Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56922 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 It is in the inbox and still isnt rendering. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56924 Share on other sites More sharing options...
scott.russell Posted July 12, 2006 Author Share Posted July 12, 2006 It works now. Thanks a lot for all your help. Quote Link to comment https://forums.phpfreaks.com/topic/14397-mail-function-and-hotmail/#findComment-56928 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.