resend / resend-django-smtp-example

MIT License
2 stars 0 forks source link

Support for custom headers in email #2

Open Alecattie opened 10 months ago

Alecattie commented 10 months ago

Hello

I am trying to integrate resend for a django app. The issue is that all my images are being sent as attachments instead of inline images.

for image in images: file_path = os.path.join(img_dir, image)

        with open(file_path, 'rb') as f:
            img = MIMEImage(f.read())
            img.add_header('Content-ID', '<{name}>'.format(name=image))
            img.add_header('Content-Disposition', 'inline', filename=image)
        msg.attach(img)

    msg.send()

And in my HTML I am referencing as:

`

        </div>`

I don't know if resend doesn't support adding headers to the email, but they are being sent as attachments

Screenshot 2024-01-08 at 8 30 02 PM

This is a log from one of my emails,

Thanks in advance

CodingDive commented 3 days ago

Might be related to this issue, resend does not seem to support cid attachments https://github.com/resend/resend-node/issues/319