PHP's mail() vs PHPMailer

As I had to build an online platform that started as a very small project, I was not concerned with using anything other than PHP's built in mail() function to send simple e-mails to the users - and it worked great! However, as the platform got larger, the requirements got larger too. Before long I was messing around with headers in the php mail() function to include attachments in e-mails etc. Turns out, adding the PHPMailer functionality makes the whole process a lot cleaner and easier to maintain as the project grows. By a simple function addAttachment($attachment) you hide the complexity and it even solved additional problems with ascii codings in mails. So if you have any idea that a project grows, think about planning ahead using a tested library. It would have saved me quite some trouble.

Comments

I have used php mail(), but PHPMailer not yet. Thank you for the advices and solution.
Malbora Sinaj - Sun, 12/09/2018 - 17:16 :::
No answers yet.