Sending mail through a Gmail address via a PHPmailer SMTP script gets flagged as spam

Hi y’all,

I have a Web form I’m building for some staff members of my online community to use to notify members that their account has been suspended and for how long. No big deal, using html to POST to a PHPmailer script with all of Google’s SMTP settings (TLS mode) and the server Gmail account information filled in. It sends fine, but any account other than the backup account for the address (my personal email) receives it in the spam folder.

Now, I can understand if it was getting flagged as spam coming directly from my server, but it’s getting flagged after my server is authenticated through Google and sends it through the Gmail address.

Any idea why this is happening and what I can do to fix it? Is it because my IP (or the DO IP range) was flagged for spam from some other user?? Let me know if you need to see any of the scripts or my hosts file or anything, but everything is pretty much default.


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.

@parrella20 it doesn’t matter. But I would prefer to use your main domain.

This comment has been deleted

Look if reverse DNS work, if not rename your Droplet to e.g. To do this go to Droplet,Settings,Rename

Every mail without reverse DNS is SPAM for Google