When sending email through PHP on a local development computer I use MailHog. MailHug is a free tool that traps all of the email 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.
Every production environments has 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 a email sending provider and connect your application to your selected provider's service.
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.