Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpMailer vs. SwiftMailer? [closed]

I'm building a fairly simple PHP script that will need to send some emails with attachments. I've found these 2 libraries to do this.

Does either one have significant advantages over the other? Or should I just pick one at random and be done with it?

like image 526
Paul Wicks Avatar asked Nov 19 '08 23:11

Paul Wicks


People also ask

Is PHPMailer open source?

PHPMailer is perhaps the most popular open-source PHP library to send emails with. It was first released way back in 2001, and since then it has become a PHP developer's favorite way of sending emails programmatically, aside from a few other fan favorites like Swiftmailer.

Does PHPMailer have a limit?

PHPMailer does not set any limits, nor does the mail() function, it's only ISPs like GoDaddy that do. However, they do so by blocking access to normal SMTP ports, and/or redirecting SMTP connections to their own servers ( *.

Is PHPMailer secure?

PHPMailer doesn't create/use any SQL itself, nor does it have anything to do with javascript, so it's secure on those fronts.


2 Answers

I was going to say that PHPMailer is no longer developed, and Swift Mailer is. But when I googled ...

https://github.com/PHPMailer/PHPMailer

That suggests its being worked on again.

I've used PHPMailer a lot, and its always been solid and reliable. I had recently started using Swift Mailer, for the above reason, and it too has given me no trouble.

Now that PHPMailer is developed again, I think I'll probably give the new version a try.

So, my answer is that both are capable, and that it doesn't matter that much – choose one, learn it, use it. Both offer massive advantages over mail() and abstract away the nuances of email so that you can get on with whatever you are really trying to develop.

like image 135
benlumley Avatar answered Sep 18 '22 22:09

benlumley


Whatever the features are, they have variety in their applicable licenses:

PHPMailer - LGPL 2.1 (https://github.com/PHPMailer/PHPMailer)

SwiftMailer - MIT license (https://github.com/swiftmailer/swiftmailer)

like image 26
M A Hossain Tonu Avatar answered Sep 17 '22 22:09

M A Hossain Tonu