Jump to content

Archived

This topic is now archived and is closed to further replies.

scott.russell

Mail Function and Hotmail?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
$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.

Share this post


Link to post
Share on other sites
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());

Share this post


Link to post
Share on other sites
[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]

Share this post


Link to post
Share on other sites
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*

Share this post


Link to post
Share on other sites
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());

Share this post


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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.