PHP Mailer or postfix redirecting to gmail?

Asked

Viewed 136 times

2

I have an Ubuntu (LAMP) server and I need to send emails via PHP, but using my gmail account, I don’t want to have an email server of my own. I need to define one of the two ways below to do this:

1- Install postfix to redirect to my gmail account and use the native function mail() of PHP.

2- Use a PHP library such as Phpmailer to email using my gmail account.

Doubt:

Which option would an experienced professional use? Because?

1 answer

3


Absolutely the 2nd option. The mail() function forces you to remember to configure the OS correctly. This, in some cases, especially in shared hosting, is not possible to do.

What’s more, the user interface of these upload libraries is much more intuitive and user-friendly compared to the mail function().

There are also other features in libraries that are not available when using mail(). The Swiftmailer library, for example, has the option to set the asynchronous sending of messages.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.