We recently had to reconfigure how mail was being sent using PHP and oddly there were many sources out there that just didn’t seem to work. So here’s some sample code we put together that should work if you’re trying to send authenticated SMTP email with an attachment using Pear Mail.