Skip to content

"multipart/alternative" will not display in some email client #27

@zjjott

Description

@zjjott

I use envelopes in our project.
I found a bug:some attachment disappear in some email client (Airmail exactly)when I send email use envelopes.
I try to fix this bug,and I realize the following source is origin
https://github.com/tomekwojcik/envelopes/blob/master/envelopes%2Fenvelope.py#L276

msg = MIMEMultipart('alternative')

I inherit envelopes class and rewrite to_mime_message() function,then bug fixed

msg = MIMEMultipart('mixed')

RFC 1341 7.2.3 say:

The multipart/alternative type is syntactically identical to multipart/mixed, but the semantics are different. In particular, each of the parts is an "alternative" version of the same information. User agents should recognize that the content of the various parts are interchangeable. The user agent should either choose the "best" type based on the user's environment and preferences, or offer the user the available alternatives. In general, choosing the best type means displaying only the LAST part that can be displayed.

So why envelopes project use multipart/alternative type instead multipart/mixed?Is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions