All my emails sent ends in Spam on Gmail

All the emails I’m sending either from php using SMTP with TLS or from the web email client, end in Spam on Google Mail no matter what I do.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
November 22, 2022

Hi there,

In addition to what has already been mentioned, I could suggest sending an email to the following site:

This will generate a report for you on why your emails might be ending up in spam.

Hope that this helps!



Site Moderator
Site Moderator badge
November 22, 2022

Hi @1ecea24df6134a57a41373199e858,

First, make sure you are using port 465 or 587 for Sending messages auth and authenticating with a mail account associated with your domain.

Next, you’ll need to configure SPF, DMARC, and DKIM records on your Droplet.



DKIM For DKIM there are multiple articles you can read on how to add to your Server/Droplet as it’s a standard process.

Once you have these 3 records, you’ll need to check if your IP is on any blacklist server. There are multiple checkers for your IP address, I tend to use

Update on that issue: you only have to have one single SPF entry (better to test this with and that entry must be like:

Record type: TXT Domain name: leave it blank unless you want to use a subdomain TXT Record: v=spf1 +a +mx -all 

DMARC - I have something like:

Record type: TXT Domain name: _dmarc TXT Record: v=DMARC1; p=none 

One of the things that I couldn’t fix was: “Reverse DNS lookup or reverse DNS resolution (rDNS) is the determination of a domain name that is associated with a given IP address. Some companies such as AOL will reject any message sent from a server without rDNS, so you must ensure that you have one. You cannot associate more than one domain name with a single IP address.” This is apparently very tricky because you DigitalOcean will setup the PTR accordingly to the droplet name but if you do have multiple domains hosted on a single droplet then it won’t work. And another one that I don’t know how to solve is: " Your message is not signed with DKIM DomainKeys Identified Mail (DKIM) is a method for associating a domain name to an email message, thereby allowing a person, role, or organization to claim some responsibility for the message."

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.

© 2023 DigitalOcean, LLC.