leeming Posted December 22, 2006 Share Posted December 22, 2006 mail( ) has been working for over a year on my server, but only recently i have had members complaining to me that emails have not been sent to them...after testing this myself i found out when using mail, it will not send to my hotmail.I even tried sending it to an email it actually sends to, and having an automatic forward (that didn't work)Then i even went onto hotmail's options and set it to accept the email i was using as the "from" header... nope.. still no emaili even looked on the forums for some headers that hotmail 'like'[quote author=HuggieBear link=topic=107959.msg433816#msg433816 date=1158185415]Are you including the [b]to:[/b] address anywhere in the headers? If you are, remove it. This works well for me:[code]<?php $from_name = "HuggieBear"; $from_address = "[email protected]"; $to_name = "ToonMariner"; $to_address = "$to_name <[email protected]>"; $subject = "Give this a try"; $message = "I last tested this with hotmail.com today and it still works fine."; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: $from_name <$from_address>\r\n"; $headers .= "Reply-To: $from_name <$from_address>\r\n"; $headers .= "X-Priority: 1\r\n"; $headers .= "X-MSMail-Priority: High\r\n"; $headers .= "X-Mailer: My Test Mailer"; $success = mail($to_address, $subject, $message, $headers); if ($success) { echo "The email to $to from $from was successfully sent"; } else { echo "An error occurred when sending the email to $to from $from"; }?>[/code]RegardsRich[/quote]that didn't even work...i am totally stuck why hotmail decided not to accept any of my emails Quote Link to comment https://forums.phpfreaks.com/topic/31558-mail-not-sending-to-hotmail-but-does-to-other-email-servers/ Share on other sites More sharing options...
drifter Posted December 22, 2006 Share Posted December 22, 2006 what if your mailer was open to header injection, and people were using your form to spam and your IP is now blocked by them?just a thought Quote Link to comment https://forums.phpfreaks.com/topic/31558-mail-not-sending-to-hotmail-but-does-to-other-email-servers/#findComment-146234 Share on other sites More sharing options...
leeming Posted December 22, 2006 Author Share Posted December 22, 2006 [quote author=drifter link=topic=119596.msg489997#msg489997 date=1166760979]what if your mailer was open to header injection, and people were using your form to spam and your IP is now blocked by them?just a thought[/quote]i checked the "MAPs" site and a few others.. my server isnt blocked (i dont think any way)... but the only part of my sites that allow email.. is the registration.. i just using sum sample code to try break thru this hotmail 'block' Quote Link to comment https://forums.phpfreaks.com/topic/31558-mail-not-sending-to-hotmail-but-does-to-other-email-servers/#findComment-146241 Share on other sites More sharing options...
Daniel0 Posted December 22, 2006 Share Posted December 22, 2006 Check your junk folder. Quote Link to comment https://forums.phpfreaks.com/topic/31558-mail-not-sending-to-hotmail-but-does-to-other-email-servers/#findComment-146315 Share on other sites More sharing options...
leeming Posted December 27, 2006 Author Share Posted December 27, 2006 [quote author=Daniel0 link=topic=119596.msg490083#msg490083 date=1166777676]Check your junk folder.[/quote]I must of forgotten to add.... not in spam either... its just not getting thru to hotmail.....since i posted this.. i have been testing alot of headers to see if hotmail would like any of them.... nope.. still wont get thru....im now using this code to test....[code]<?phpif($_POST['submit']){ $recipient = $_POST['email']; $subject = "Complete your Bavad.Com Registration"; $headers = "From: leeming <[email protected]>\r\n"; $headers .= "Reply-To: leeming <[email protected]>\r\n"; $headers .= "Return-Path: leeming <[email protected]>\r\n"; $headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/plain; charset=ISO-8859-1;\r\n"; $headers .= "Message-ID: <". time() .rand(1,1000). "@".$_SERVER['SERVER_NAME'].">". "\r\n" ; $headers .= "Date: ".date("r")."\r\n". $headers .= "Subject: ".$subject."\r\n"; $message = "Welcome to bavad.com! lets talk\n about loads of stuff\n password and stuff here"; if(mail($recipient, $subject, $message, $headers)) { echo "Mail (apparently) sent"; }}echo("<form name='email' method='post'>");echo("Recipieint: <input type='text' name='email' size='30'> <input type='submit' name='submit'>");?>[/code]~edit~after more and more research on this topic, i am coming to the conclusion it is hotmail blocking the server or what ever, instead of the headers.. (kinda as bad as AOL)if there any way i can find out if my server is blacklisted *like said originally, i checked, but it said i hadn't*extra info for ya:My server is LinuxApache version: 1.3.37 (Unix)And its data center is in Texas i think...could any of them factors affect it in any way?i will continue researching this... Quote Link to comment https://forums.phpfreaks.com/topic/31558-mail-not-sending-to-hotmail-but-does-to-other-email-servers/#findComment-148158 Share on other sites More sharing options...
Jessica Posted December 27, 2006 Share Posted December 27, 2006 Have you tried other hotmail accounts? Quote Link to comment https://forums.phpfreaks.com/topic/31558-mail-not-sending-to-hotmail-but-does-to-other-email-servers/#findComment-148163 Share on other sites More sharing options...
leeming Posted December 27, 2006 Author Share Posted December 27, 2006 [quote author=jesirose link=topic=119596.msg491963#msg491963 date=1167198309]Have you tried other hotmail accounts?[/quote]You caught me as i was adding an edit..yes i have tried more hotmail accounts... its the reason it popped up in the 1st place, because my members where complaining to me they wasn't getting an email Quote Link to comment https://forums.phpfreaks.com/topic/31558-mail-not-sending-to-hotmail-but-does-to-other-email-servers/#findComment-148166 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.