Updated to work with 3.1

Plain text, HTML email, attachments, Cc and Bcc all work fine.