Don't throw an exception for .eml attachments with broken MIME.

This function used to fail when creating an attachment that happened to
contain text with broken MIME. Now when that happens, we just encode it
and call the attachment type 'text/plain'.
Label broken MIME attachments as ContentType: application/octet-stream rather than ContentType: text/plain