mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
also consider Content-ID when marking attachment as inline (#126)
Handle MIME attachments with Content-ID as inline by default. Treat MIME attachments that have a *Content-ID* but no explicit *Content-Disposition* header as inline, matching the behavior of many email clients.
This commit is contained in:
committed by
Mike Edmunds
parent
4028eda583
commit
64f7d31d14
@@ -88,6 +88,15 @@ and :meth:`~email.message.Message.add_header` should be helpful.)
|
||||
Even if you mark an attachment as inline, some email clients may decide to also
|
||||
display it as an attachment. This is largely outside your control.
|
||||
|
||||
.. versionchanged:: 4.3
|
||||
|
||||
For convenience, Anymail will treat an attachment with a :mailheader:`Content-ID`
|
||||
but no :mailheader:`Content-Disposition` as inline. (Many---though not all---email
|
||||
clients make the same assumption. But to ensure consistent behavior with non-Anymail
|
||||
email backends, you should always set *both* :mailheader:`Content-ID` and
|
||||
:mailheader:`Content-Disposition: inline` headers for inline images. Or just use
|
||||
Anymail's :ref:`inline image helpers <inline-images>`, which handle this for you.)
|
||||
|
||||
|
||||
.. _message-headers:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user