Script Generated emails getting marked as spam

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mzfp2
Forum Contributor
Posts: 137
Joined: Mon Nov 11, 2002 9:44 am
Location: UK
Contact:

Script Generated emails getting marked as spam

Post by mzfp2 »

Hi

My website produces automatic emails for users to activate their accounts when they register.

However for many users with hotmail or yahoo accounts, these generated emails are ending up in their spam or junk folders, and therefore seriously affecting the number of people that register succesfully.

Is there any way to avoid such a problem (I am using sendmail function).

Many Thanks
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

One problem that may occur is the fact that email gets sent as HTML email. Most SPAM filters automatically flag an email as SPAM if an email is all HTML.
Also, in Hotmail at least, users can set up their accounts to mark as SPAM, all email that doesn't come from a list they've set up. Your users may have this set up.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
raging radish
Forum Commoner
Posts: 32
Joined: Sun Nov 14, 2004 3:02 pm
Location: Toronto

Post by raging radish »

I was having the same issue. I changed the From: and Reply-To: headers to a valid domain and the mail goes through.

Code: Select all

mail("recipient@domain.com", "Subject", $message,
     "From: my_email@{$_SERVER['SERVER_NAME']}\r\n" .
     "Reply-To: my_email@{$_SERVER['SERVER_NAME']}\r\n" .
     "X-Mailer: PHP/" . phpversion());
Post Reply