Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML + TXT when there is an attachment #32

Open
omacchioni opened this issue Nov 9, 2012 · 2 comments
Open

HTML + TXT when there is an attachment #32

omacchioni opened this issue Nov 9, 2012 · 2 comments

Comments

@omacchioni
Copy link

Hello,

I'm tying to send an e-mail with HTML + TXT content, as well as an attachment.

The issue I'm facing is that the body of the e-mail shows both the HTML and the TXT version one after the other.

The headers looks like:

[...]
Content-Type: multipart/mixed; boundary="===============4807966042008734145=="
MIME-Version: 1.0
Subject: XX

[...]

--===============4807966042008734145==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

[...]


--===============4807966042008734145==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit

[...]


--===============4807966042008734145==
Content-Type: application/octet-stream
MIME-Version: 1.0
Content-Disposition: attachment; filename="file.pdf"
Content-Transfer-Encoding: base64

[...]

Based on what I see by sending an e-mail from a real mail client, I assume they should look like:

[..]
Content-Type: multipart/mixed;
    boundary="_004_151D0F7563C8AE4DBD9C01360BBF70A22B989834SG000711corproo_"
MIME-Version: 1.0

--_004_151D0F7563C8AE4DBD9C01360BBF70A22B989834SG000711corproo_
Content-Type: multipart/alternative;
    boundary="_000_151D0F7563C8AE4DBD9C01360BBF70A22B989834SG000711corproo_"

--_000_151D0F7563C8AE4DBD9C01360BBF70A22B989834SG000711corproo_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

[...]
--_000_151D0F7563C8AE4DBD9C01360BBF70A22B989834SG000711corproo_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
[...]
--_000_151D0F7563C8AE4DBD9C01360BBF70A22B989834SG000711corproo_--

--_004_151D0F7563C8AE4DBD9C01360BBF70A22B989834SG000711corproo_
Content-Type: application/pdf; name="xx.pdf"
Content-Description: unknown.pdf
Content-Disposition: attachment; filename="xx.pdf"; size=160899;
    creation-date="Fri, 09 Nov 2012 09:59:36 GMT";
    modification-date="Wed, 14 Mar 2012 09:35:49 GMT"
Content-Transfer-Encoding: base64
[...]

Did anyone experience this issue? Is there a fix available?

Olivier

@sharoonthomas
Copy link

Is the problem in the PDF or the appearance of the email ?

@omacchioni
Copy link
Author

The problem is the appearance of the mail.

When encountering a Content-Type: multipart/alternative;, the Mail client will select the most appropriate format to display the e-mail (either the text/plain or the text/html version). This is the expected behavior.

Poweremail generates - wrongly - a multipart/mixed content-type, so the e-mail client will display both versions - for the user, the content of the e-mail is present twice in the body of the mail.

I didn't check if poweremail has the same issue when there is no attachment to the e-mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants