it depends on your needs. Here is useful guide how to send emails using PHP and SMTP with all info about the basic PHP email sending principles, syntax, and parameters.
Here’s what you can do with PHP built-in mail function():
create simple HTML/text messages without attachments and images
send them to one or several recipients
include additional headers to the message
add additional parameters to the `sendmail` command
Also you can use third-party email sending services like Mailtrap, Sendgrid, Mailgun.