jeremyephron / simplegmail

A simple Gmail API client for applications in Python
MIT License
336 stars 73 forks source link

Add headers to email attachments #93

Open bprimc opened 1 year ago

bprimc commented 1 year ago

Example usage:

    def find_attachment_by_cid(cid: str) -> Attachment | None:
        for att in message.attachments:
            for header in att.headers:
                if header['name'] == 'Content-ID' and header['value'] == f'<{cid}>':
                    return att