Constructing mime image attachment

DL Neil PythonList at DancesWithMice.info
Thu May 28 18:10:07 EDT 2020


On 28/05/20 11:48 PM, Joseph L. Casale wrote:
> I have some json encoded input for nodemailer (https://nodemailer.com/message/embedded-images)
> where the path key is a string value which contains the base64 encoded data such as:
> 
> {
>      html: 'Embedded image: <img src="cid:unique at nodemailer.com"/>',
>      attachments: [{
>          filename: 'image.png',
>          path: 'data:image/png;base64,iVBORw....',
>          cid: 'unique at nodemailer.com'
>      }]
> }
> 
> Does an approach exist to construct a MIMEImage object with the existing
> base64 string without parsing it and decoding it?


Might the Python Standard Library modules for Internet Handling offer 
suitable facilities, eg base64 or mimetypes?
https://docs.python.org/3/library/netdata.html
-- 
Regards =dn


More information about the Python-list mailing list