PHPMailer works great but I've read that it is no longer in active development.
I found another alternative.
http://www.swiftmailer.org
The license is lgpl.
Features are:
* Persistent connectivity improves performance
* Connection types selected by user - extendable
* Complete header control with RFC 2822 requirements handled
* Internationalization support (i18n)
* Connection redundancy support
* Load balancing and/or throttling support
* SSL & TLS Support - for Gmail servers
* Embedded images or other file types
* Full MIME 1.0 library included (create multipart messages, attachments etc)
* Batch mail processing
* Smart runtime caching (in small, self-maintained packets)
* Send attachments of any size even with PHP's 8MB Memory Limit
* Support for multiple attachments
* Lossless protection against header injection (encode, don't strip)
* Set message priority
* Request read receipts
* Pluggable SMTP authentication (LOGIN, PLAIN, MD5-CRAM, POP Before SMTP)
* Anti-flooding support for servers with limits on emails-per-connection
* Bandwidth monitor included
* Extensive event-driven plugin support (easy to write)