Inline Images are also being attached

I am using templated_email package to send emails and embedding images using the below code block. Inline images are also being added as attachments in some devices. I don't want them to be added as attachments. Is there any solution?

        with open(path_to_img, 'rb') as image:
            image = image.read()
        inline_image = InlineImage(filename=image_name, content=image)

This is the documentation of the templated_email package https://pypi.org/project/django-templated-email/#:~:text=with%20open(%27pikachu.png%27%2C%20%27rb%27)%20as%20pikachu%3A

I found a solution where if we use MIMEMultipart('related') it will solve the issue if we are using MIME to embed images directly. I want to implement the same while using Django's templated_email package.

Back to Top