i managed to make sendmail work and i can send email out with mail() in PHP. however that email always goes to spam. my domain is new, has never been used before. i read that i have to create reverse DNS (i really have no idea how to do it) to avoid emails to be delivered to spam folder. does anyone know what exactly do i have to do to see email sent from my php script to appear in INBOX (gmail)?
thank you!
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.
Hi,
you are right, you need a reverse DNS record. DigitalOcean sets this record based on the hostname of your droplet automatically. You can check your settings with the command:
If you wish to update your rDNS record, you can rename your droplet in the control panel:
And I recommend you to create SPF and DKIM records, too.
You’re PTR should coincide with your hostname, just ask DO to update your PTR.