-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Attachments not recognized since 6.7.0 in MS outlook/hotmail/gmail #2938
Comments
Can you show the SMTP transcript of sending a message that's failing in this way? Have you tried comparing messages created by the two different versions to see what the difference is? |
Hi, I compared generated body and found the issue is caused by missing MIME preamble Showing attachments properly 6.6.5:
Attachment not shown 6.8.0:
After I manually added preamble attachments showed up properly. |
That is annoying. The preamble is entirely optional in the RFC - anything before the first MIME boundary should be ignored, and otherwise it breaks PHPMailer's DKIM, which is why it was removed. Are you sure those line breaks are exactly as in your message? There should be a blank line after the CTE header. |
@Synchro I am using quite outdated client MS outlook 2010, not sure how it follows RFC. That could be excuse to ignore this thing. Unfortunately, I also noticed attachments not showing on gmail.com and hotmail.com - which should not be ignored. Perhaps you/somebody could double check & confirm that? Strange if nobody noticed that by now .. |
That binary view is concerning - I suspect the reason it's working in the old one is not because of the preamble, but because of the position of the line break. Without a blank line before it, the preamble looks like a malformed header, and will probably be ignored, but the line after it will act as a acceptable separator between headers and body. In the 6.8 example, the break occurs after the boundary, meaning that the boundary will also be interpreted as a malformed header, but here it's more significant because it results in a broken MIME structure (i.e. the first boundary is effectively missing). |
@Synchro , what break? Note the line count on the right. What about setting |
There should be a blank line between lines 10 and 11 in both of them because the preamble (or lack of one) is part of the body, not the headers. I need to look at the assembly of the message to see why the body isn't getting a break in the right place. Doing that with mimepre is a bit of a hack; I'd prefer to fix it properly! |
I checked this and it turns out the line works for me without using this hack, also looking at SMTP code confirms that it should work properly. Gmail can recognize attachments. @lubosdz, what transport were you using? Were you using SMTP? |
@zb3 Thank you for checking .. I am not sure actually .. they were stored first as local |
It would help to see the code you're using to generate those messages. If you set I recommend using SMTP to localhost over the default The best way of keeping a copy of messages you send is to BCC yourself and have your mail server pipe the message back into your database. While it's fiddly to set up, the big upside of this approach is that you are guaranteed that the message is an exact copy of what was really sent, so things like DKIM signatures and message IDs (that might be generated by the server) will be present and correct, which may not be the case with local simulations like |
Problem description
After upgrading to latest PHPMailer 6.8 emails stopped displaying file attachments. By downgrading traced back that issue started with 6.7.0 release. Last working was 6.6.5. Since 6.7.0 attachments will not be recognized in MS Outlook 2010 client and neither on hotmail.com & gmail.com (!).
I suspected that issue could have been related to newly added method
stripTrailingBreaks()
but cannot confirm - attachments still not recognized even if the method does not strip off trailing whitespaces.Anyone experiencing same issue?
Here is commit comparison 6.6.5 - 6.7 - if you have any tip what's wrong pls drop it here, I will check out.
The text was updated successfully, but these errors were encountered: