Jump to content


Photo

Mail Function and Hotmail?


  • Please log in to reply
26 replies to this topic

#1 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 12 July 2006 - 05:52 PM

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.

#2 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 12 July 2006 - 05:54 PM

probably in their spam boxes.
http://www.DaveLinger.com
dave at linger dot com

#3 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 12 July 2006 - 05:55 PM

It's not in there Spam boxes there not getting them at all.

#4 akitchin

akitchin
  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 12 July 2006 - 06:16 PM

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.

#5 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 12 July 2006 - 06:21 PM

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.

#6 akitchin

akitchin
  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 12 July 2006 - 06:22 PM

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.

#7 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 12 July 2006 - 06:25 PM

I took out the x - headers and yes im using a real email address and it still isnt working.

#8 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 12 July 2006 - 06:32 PM

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:
<?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);
?>

Ken

#9 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 12 July 2006 - 06:41 PM

$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.

#10 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 12 July 2006 - 06:41 PM

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_username
Password: $login_password_paassword
   
Thanks!

The Webmaster

This is an automated response, please do not reply!";

mail($email, $subject, $message,"From: allinthissite members<sales@allinthissite.co.uk>\n X-Mailer: PHP/" . phpversion());

#11 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 12 July 2006 - 06:44 PM

It still doesnt work off mine.

#12 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 12 July 2006 - 06:47 PM

send me all ur code and ill test it..

#13 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 12 July 2006 - 06:50 PM

$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);



#14 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 12 July 2006 - 07:01 PM

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*

#15 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 12 July 2006 - 07:09 PM

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());

#16 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 12 July 2006 - 07:11 PM

try the above code mate and tell me if that works.. i got an email to my msn, but dunno about user@hotmail.com....

#17 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 12 July 2006 - 07:26 PM

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.

NoGray.com


#18 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 12 July 2006 - 07:27 PM

Warning: mail(): SMTP server response: 553 5.0.0 Unbalanced

I got this error when I tried it.

#19 brown2005

brown2005
  • Members
  • PipPipPip
  • Advanced Member
  • 943 posts

Posted 12 July 2006 - 07:30 PM

wat email address u trying to send to, i will check on my comp


#20 scott.russell

scott.russell
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 12 July 2006 - 07:32 PM

Squall8046@hotmail.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users