Home » Php » What is the best practice to send emails from PHP script?

What is the best practice to send emails from PHP script?

Posted by: admin July 12, 2020 Leave a comment


I hope this question wont be too specific. But I really need to ask. We all know that we cannot fully prevent our emails to go to spam box right? But I guess we can decrease the #of emails that goes there.

Till now, I use PHP’s built-in function mail() but I guess there are other methods right? What are they and what is your best practice for this prblem?

Also is there a way to sending emails through Google Appspot? Thanks!

How to&Answers:

A hosted service may be a better way to go. They’ve developed procedures, and relationships with ISPs, that will help get your e-mails delivered and will help you fend off spam complaints.

I have a mailing list for a blog that I run, and I decided not to send out an e-mail that had an (otherwise legitimate) story that dealt with a pharmacy. I figured almost nobody would get the e-mail, and that I’d get a lot of spam complaints, just because of the word “pharmacy.”

Provide useful information in your e-mails first and foremost. Use double opt-in procedures. That will reduce the probability of your e-mail being sent to spam.


I am using Swiftmailer.

If you read the docs and follow guidelines, you will have much less mails landing in the spam folder. I have used it with great success. It also has some useful plugins.