I’m a fan of Swiftmailer for sending emails through PHP – it’s a much more elegant alternative to the
mail()function and recently was absorbed into the Symfony project, so its future seems certain. A big plus is its support for sending mail using the
<a href="ht<code></code>tp://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol">SMTP</a> protocol, which makes it great for more complex scenarios where authentication or performance are concerns.
Up until this week I’d only used Swiftmailer on Windows, with an SMTP server on our network. This changed when I needed to do a demonstration using my Macbook, and as OSX comes installed with Postfix I thought everything should just work if I configured Swiftmailer to use an SMTP server on
localhost at the standard port (25). This was nearly the case – as I read here while Postfix is installed, it’s not enabled by default. After following the steps outlined there email started sending as expected.