This will diverge from the original discussion so I'll start a new thread.
On 2014-06-11, 9:22 PM, Tim Starling wrote:
In other news, I found a serious security vulnerability in SwiftMailer and have reported it upstream.
On 2014-06-11, 10:55 PM, Tim Starling wrote:
Swift, by contrast, is a 43 KLOC monolith which does all three things and a kitchen sink of other bits and pieces, like its own dependency injection system (Swift_DependencyContainer) supported by a custom autoloader. Maybe we should think about installing PEAR Mail in the vendor directory using Composer, instead of Swift.
If you don't like Swift Mailer's code, I did bring it up during the RFC, but Swift Mailer isn't the only well maintained mailer library.
Besides Swift Mailer there is also PHPMailer: https://github.com/PHPMailer/PHPMailer
Which seems to be the mailer WordPress uses. They say Drupal uses it though I'm unsure of what Drupal's default is because of their convoluted plugin structure (just attempting to hunt down the URL to clone Drupal core's git repo from was hard enough, even the second time around).
I let things move on with Swift after Parent5446's comment on the subject:
This is not comprehensive, but Swift_Mailer seems to be a **lot** more robust. PHPMailer has everything packed into a few classes, whereas Swift_Mailer actually has a separation of concerns, with classes for attachments, transport types, etc. A result of this is that PHPMailer has two different functions for embedding multimedia: addEmbeddedImage() for files and addStringEmbeddedImage() for strings. Another example is that PHPMailer supports only two bodies for multipart messages, whereas Swift_Mailer will add in as many bodies as you tell it to since a body is wrapped in its own object. In addition, PHPMailer only really supports SMTP, whereas Swift_Mailer has an extensible transport architecture, and multiple transport providers. (And there's also plugins, and monolog integration, etc.) Parent5446 22:56, 7 March 2014 (UTC)
-- https://www.mediawiki.org/wiki/Talk:Requests_for_comment/Third-party_compone...
Which doing a bit of digging myself appears to be partially incorrect. Looking at the code PHPMailer does support mail() and sendmail in addition to SMTP. So it basically supports the exact same list of email sending methods as Swift Mailer's transports do.
So if you don't like the kitchen sink that Swift was picked for PHPMailer is something else to review before falling back on PEAR libraries, even with composer.