Most CMS (Joomla for example) comes with php mail()
as default and has the option of changing it to SMTP
if we want. I will be setting up both the webserver and mail server (Postfix) in the same VPS on Debian 7. What I am trying to understand is:
Delivery Reputation: Would using php mail() vs SMTP make any difference with the delivery rate? From what I understand, Postfix is going to be using SMTP protocol when communicating with other servers on the internet when delivering emails, so therefore is it safe to assume that it doesnt matter if the email was sent to postfix via php mail or smpt from localhost? Does any of these 2 methods affect the email reputation is any ways even in a small way?
Performance Load: Is there any performance difference between php mail and SMTP when sending emails? Say, if I am sending like 10,000 emails, which method would take the most resources (or time)? My assumption is that both can take a bit of time like: php mail for compiling the emails with headers, etc.. and SMTP for making connections each time. Which one consumes the most server resources?
Security Issue: When I searched for the difference between the two, many sites says about the security issue with php mail since a hacker can upload php script to send out spams. But I can also see another security issue with SMTP as well since the SMTP username and passwords are stored in configuration file in text which is not secure neither. Since there are security issues for both methods, does one weigh better than the other in any aspects?
Preference: If I am able to set up both phpmail and SMTP on my server, should I give preference to use one over the other for any reason? I mean, if I can use SMTP in my server, should I then try to use SMTP instead of phpmail due to various reasons covered in the above points?
Background: My machine is going to be a simple web server that uses postfix just for sending out emails from Joomla, newsletters and root email from various services.