Jens
Jens

Reputation: 1507

Hotmail rejecting php's email's

My website sends activation mails to new members using the php mail() function. I manage my email accounts using the google mail service (aspmx.googlemail.com). But unfortunately, Hotmail users receive the activation email in their unwanted folder.

I did some research and found out about SPF records (I can not use keys since I have limited control over my webserver). So how do I configure my SPF record?

I now have:

v=spf1 a mx a:mywebsite.net include:aspmx.googlemail.com ~all

Would this be what I need?

EDIT: I now used PHPMailer to connect to the google SMTP server. Hotmail no longer marks them as unwanted this way. (http://sourceforge.net/projects/phpmailer/)

Upvotes: 3

Views: 4549

Answers (2)

Harold
Harold

Reputation: 228

Inorder to utilize that SPF record you need to add it to your DNS Zone file.

Go to wherever you have your DNS registered and add a couple of TXT records.

They should look something like:

mywebsite.net. IN TXT "v=spf1 a mx a:mywebsite.net include:aspmx.googlemail.com ~all " mailserver.mywebsite.net. IN TXT "v=spf1 a mx a:mywebsite.net include:aspmx.googlemail.com ~all "

There is a ton of great info over at http://www.openspf.org/

This will not guarantee that your message will get through the spam filters, but it will help.

The other thing todo is get "whitelisted" with the Hotmail team. It has been a while, but you essentially register your machine with a contact. This allows them a person to complain to directly when questionable material comes from your site. They tend to let more of your mail through after you get yourself "whitelisted".

Upvotes: 3

jps
jps

Reputation: 11597

PHP's mail() is probably not using smtp to send your emails. I would consider adding the appropriate headers and using a spam scorer to help your chances, or you could try and use smtp through google's mailservers (although I bet that is unlikely).

Here is a spam scorer:

http://www.contactology.com/check_mqs.php

Here is an example of some email headers, be sure to set your From header as its default probably isn't good for spam filters:

$headers  = "From: My site<noreply@my_site.com>\r\n";
$headers .= "Reply-To: info@my_site.com\r\n";
$headers .= "Return-Path: info@my_site.com\r\n";
$headers .= "X-Mailer: Drupal\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail($recipient, $subject, $message, $headers);

Upvotes: 3

Related Questions