1

I have an application hosted on amazon EC2. Now a user can send out invitations to join but on most email clients its showing up in the spam folder. Is there anyway to find out on what criteria it is actually being filtered.

SNAG
  • 2,011
  • 2
  • 23
  • 43
  • This is happening in the very first instance. I have hosted the application today so it could not have been blacklisted even I did send out email in bulks. I have sent out only 7 and 6 are in spam – SNAG Mar 02 '12 at 07:45
  • Nope. There's plenty of rules that determine in which folder a mail is going to land. Maybe try sending a *real* e-mail. Your IP / hostname may be blacklisted or your invite may match a filter pattern of some kind. Hard to tell. – user703016 Mar 02 '12 at 07:46

2 Answers2

2

First of all, please check to see if your domain/IP has landed on any blacklists:

https://www.mxtoolbox.com/blacklists.aspx

Second of all, have you set an SPF record? Explanation below:

http://www.openspf.org/Introduction

https://mxtoolbox.com/spf.aspx

This is a way to qualify a particular server/IP as being a valid for relaying/sending mail on behalf of a particular domain. Sendmail - or whatever PHP is configured to use to send mail - can actually send mail for any user on any domain (i.e. "spoofing"). However the server receiving the mail (e.g. a recipients POP3 server where received mail is stored and filtered) is probably going to check whether or not that server is supposed to be sending mail for that domain based on what's in the domain's DNS entries. In particular, it will probably check the SPF record, so you will need to set this. You should consult whichever service manages your DNS (i.e. your nameservers) for how to do this. You can look up where your nameservers are using the whois, dig or nslookup commands (or just use a web based whois service) - look for the "nameserver" entries, often denoted by "ns".

This is one of a number of factors that may be affecting whether or not your mail goes to spam. This subject is something of a "can of worms" and goes way beyond setting up your PHP mail function correctly. Rather than trying to reiterate all of these issues here, I'll direct you to this post on serverfault:

https://serverfault.com/questions/106598/all-my-emails-to-yahoo-hotmail-and-aol-are-going-to-spam-though-ive-implemen

Aaron Newton
  • 2,124
  • 1
  • 28
  • 31
  • Also, you should check out these EC2 specific posts http://stackoverflow.com/questions/5292170/ec2-fresh-php-install-mail-not-working https://forums.aws.amazon.com/thread.jspa?threadID=72067 – Aaron Newton Mar 02 '12 at 09:40
0

Do you use 5th parameter in mail function?

mail('reciever@address.com', 'the subject', 'the message', null,
   '-fyour@address.com');

It helps sometime.

Also maybe your IP was blocked before you start to use it.

Narek
  • 3,813
  • 4
  • 42
  • 58