What kind of service/server do I need to send email and avoid it being in Spam.
20 replies, posted
Hey, I've made a basic website with a field to subscribe (via email) using LAMP stack.
But when I go to use mail() in PHP, the email ends up in Spam folder.
What kind of service or server do I need to avoid getting marked as spam? Do I need SSL certificate or how does spam marking work?
I personally use Mailgun which has a pretty good free plan if you don't send many emails per month. I also use mail-tester for testing how "spammy" my emails are. However, I still get problems with emails destined for Hotmail/Outlook and Yahoo going straight to junk.
I will try Mailgun later tonight, seems like decent service.
Can you send links in email via it and avoid being marked as spam? (I am basically sending a link to my website in email that links to PDF download)
Mailgun won't stop your mail from being marked as spam if the content still looks "spammy", it just prevents your mail being marked as spam because the mail came from an untrusted server (ie, your personal server) If the only reason your mail is being marked as spam is the content, then switching to Mailgun won't help much.
I use Mailgun on a large project (1000+ e-mails a day) and here are some tips from my experience dealing with spam:
Sending links in mail is generally OK, however some spam-filters will look for "link to text ratio" ie. how much of your mail is just links, having a high link to text ratio can indicate that the message is spam. TLDR don't send emails that are just links.
"Personalization" is important, if you send the same message to many accounts it can get you marked as spam. The best way to avoid this is to personalize your email "[real name] here is your activation link" instead of "Here is your activation link"
Do not overuse HTML in your mail, and avoid embedding images
Always include a "text-only" version of your mail (See here)
Avoid sending large batches of mail at the same time (makes you look like a mailing list/spammer to spam filters)
If you are running a mailing list, always include a "Click here to unsubscribe" link
You should also note that Mailgun can and will shut down your account if you send too many spammy mails, which effectively means they prevent you from sending any mail until the issue is resolved. Adding a credit card to your account makes this less likely to happen in my experience. If you register a free account and start sending lots of mail that is marked as spam then you will likely just get your account shut down.
My email content basically looks like:
Hi [Name],
Click [Here] (hyperlink) to download your free copy of [book name] eBook.
I guess I should remove word free?
Yea "free" is a big nono.
Also the "subject" of your mail is very important, if your subject field is also "Free eBook download" you are basically identical to spam.
Alright I will give it a try.
Thanks.
Also "Click here" might be trigger word for spam filters
Your eBook is ready for [download] (hyperlink) ?
I think that is a lot better than what you started with. A good think to do in these cases is look for what other professional services do, ie. see if you can find any other service that does something similar and copy the general content of their mail.
This is just speculation, but linking directly to a pdf file may not be optimal because a lot of malware is sent in the form of infected pdf files. Again this is just me speculating.
Here is an example of how Bandcamp does album purchase emails:
Greetings [my name]! Thank you for purchasing:
Identity Sequence, digital album, $9.00
Total: $9.00 USD
If you haven’t gotten your download already, click here. Try this if you need help downloading.
If you want to contact zircon for any reason, please click right here.
Purchased 21 January 2013 10:05 PM ~ Payment [id] ~ PayPal transaction ID [transaction id]
So would a link to dedicated download page on my site be better? Or unique download link for each user?
My main issue now is what appears to be DNS settings.
https://i.imgur.com/qHr0pdl.png
I am using DigitalOcean as host, and all emails I send arrive from actual server name instead of domain.
If you're in school/univeristy you can get github education for free which includes a fuckload of emails on SendGrid, I've used them for just under a year now and I've never had problems with emails going to spam
https://education.github.com/pack
https://sendgrid.com/
One extra step to get out of spam is to setup an RDNS on your IP. What that does is resolve the IP of your mail server to a domain name as well. For example one of my dedicated servers is using this IP for its web server: 104.128.48.140
Now if you do an RDNS lookup with a tool like this: Reverse DNS Lookup
You'll see that my IP resolves to "webcp.jonathandroogh.com".
To set this up you'll need a dedicated IP for your web hosting service that you've got with DigitalOcean, I'm not sure if they offer them though. Once you've got that then ask DigitalOcean to setup an RDNS on your IP and list the domain name you want it to resolve to. Only your web hosting provider (the entity/person that owns said IP) can do such a thing.
Lots of good suggestions already, but one thing you might also want to check is the reputation of the IP addresses and domains you're using. In shared webhosting it's not uncommon to see spam/blacklisting issues being passed around. Mxtoolbox has some nice tools for identifying spam/blacklist issues.
Reputation also goes up or down over time depending on the activity the blacklist providers detect from your IP/domains.
Yeah, there is lots of potential for something to go wrong with the header. This article starts off a bit basic, but about two-thirds of the way in there are some useful takeaways.
https://www.1and1.com/digitalguide/e-mail/technical-matters/the-e-mail-header-and-its-role-in-the-world-of-spam/
Sorry, you need to Log In to post a reply to this thread.