PHP Mailer or postfix redirecting to gmail?

2

I have a Ubuntu server (LAMP) and I need to send emails via PHP, however using my account in gmail, I do not want to have an email server of my own. I need to set one of two ways below to do this:

1 - Install postfix to redirect to my gmail account and use PHP's native mail function.

2 - Use a PHP library like PHPMailer to send email using my gmail account.

Doubt:

Which option would an experienced professional use? Why?

    
asked by anonymous 15.09.2014 / 07:52

1 answer

3

Certainly 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.

What's more, the interface for using these sending 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 of configuring asynchronous sending of messages.

    
15.09.2014 / 10:05