Jump to content

Mail Function and Hotmail?


scott.russell

Recommended Posts

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.
Link to comment
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.
Link to comment
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
Link to comment
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.
Link to comment
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());
Link to comment
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]
Link to comment
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*
Link to comment
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());
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.