Fix code for eml email attachments for Python 3