• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1848
  • Last Modified:

Function mail() in PHP versus Hotmail Junk Mail Box

I develop a function of sending of emails in PHP (on a dedibox, OS =  Fedora core5) by using the function mail($email_address, $subject, $message, $header).
PROBLEM: The mails sent arrive in the junk mail box of hotmail between-others.

How to make so that the messages fall into the "reception box" from my recipients?

I sailed through many forums and I am partly persuaded that all depends on the fourth parameter of mail().
If you know the good configuration of the $header, or of the server, I thank you in advance.
  • 3
  • 2
1 Solution
Does it even go to the junk folder? There are some specific headers you have to have to make it to hotmail.
I could tell you about the headers but this sounds more complicated.

Perhaps one good way is to test it against a server with spam assassin or something similar and see the reasons you get spam score. Then try to eliminate these reasons.
KCTeamAuthor Commented:
For the moment, i use only "simple email sending", with few text and an url link.
The idea you gave is pretty good cpulse, but spamassassin doesn't work as the Hotmail server.

What i need to know is "how configure my fourth parameter in the PHP function in the aim to send emails that won't be filter as spams by HOTMAIL ?" (it's a pretty difficult question)

$mailHeaders = 'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'From: Demo <demo@example.com>' . "\r\n" .
'Reply-To: demo@example.com';

mail($mailTo, $mailSubject, $mailMessage, $mailHeaders, '-f demo@example.com');

Actually the fifth parameter that is important, it send email from the actual user and not from nobody@hostname.com.

The above example is for HTML emails, if you dont use it then change the Content-type.

Secondly, implement SenderID/SPF for your domain. All configurations are easily obtainable from
a. Microsoft : http://www.microsoft.com/senderid/wizard
b. SPF : http://www.openspf.org/

Moreover, if your domain is new then it will stay in MSN spam filter unill it believes that you are not a spammer.

Hope this helps.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Forgot to mention MSN Postmaster Guidelines at http://postmaster.msn.com/
KCTeamAuthor Commented:
With our team we solved the problem partly. Which poses problem it's that the mails we send to a member of voila.fr aren't throwed in its reception mail box.

I would like to know the criteria of voila.fr concerning the undesirable mails...or a solution to permit us to finish our job.

Thanks for help ;-)
KCTeamAuthor Commented:
Thanks for your answer

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now