Login

Snippet by [email protected]

Snippet List

Take a django.core.mail email message and replace any MEDIA_URL-served images with attached images

The code here will take an EmailMessage from django.core.mail and replace the sourcing of any images served by the application with attached image content. Note: This expects a valid closing tag of **/>** on img elements, it will not properly handle filenames with **'** characters in it, and it does not handle if invalid image sources are listed.

  • email
  • attachment
Read More