Alex Rivera | Logout

PhpMailer vs. SwiftMailer?

Asked 2008-11-19T23:23:28.817
65

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?

Edit
Report

1 Answer

6

Google trends: swiftmailer is growing but phpmailer is still very strong.

I would go with Swiftmailer because documentation is clear and easy. Phpmailer site/docs are a bit messy (at least they look so).


EDIT: after trying them both (and banging my head against an hosting issue for which SwiftMailer did not output any type of hint) I completely changed my mind, I would definitely go with PHPMailer for at least one good reason: it's much easier to debug in the event you have any issue.

Both SwiftMailer and PHPMailer provide debug options (SwiftMailer with a plugin and PHPMailer by turning on SMTPDebug = 2), but SwiftMailer is made by hundreds of small files that make SwiftMailer more difficult to debug compared to the 3 files PHPMailer is made of.

And about docs, the PHPmailer documentation is less fancy looking, but it has got all you need: simple tutorial, examples

answered 2013-02-25T19:01:53.643

Your Answer