added support for different types of attachments, now image/png, text/html, text/plain and application/javascript base64 strings are supported