Tools for Sending, Developing, and Testing PHP Application Email

MailHog 1

When sending emails through PHP on a local development computer I use MailHog. MailHug is a free tool that traps all of the emails sent from your local application and provides an interface to view those emails. Emails trapped by MailHog are not sent to your email recipient making it the perfect tool for testing.

When using MailHug with PHP be sure you integrate MailHog into your php.ini file.

When I need to test email on a staging environment I use Mailtrap. MailTrap is a paid service that works a lot like MailHog but provides a number of additional debugging options and features.

mailtrap 1

Every production environments have different requirements. However, all production applications will require DKIM and SPF validation under the DMARC standard to keep your application’s emails out of spam. The best way to get DKIM and SPF validated is to use an email sending provider and connect your application to your selected provider’s service.

I have used Postmark, Mailgun, AWS SES, SparkPost, Mandrill, and SendGrid.

If you have not used an email sending provider before each of them functions the same at a basic level. Try them all over time and eventually you will find one that you like.

If you are curious about DMARC, DKIM and SPF watch this video.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.