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
Multipart - missing extra EOL #2008
Comments
Neither of those examples are correct because there should always be a blank line between headers and body. RFC2046 says that the boundary string must be preceded by a line break. The RFC has this to say about the preamble (the bit you're talking about):
and that's exactly what we are doing here. There is another applicable note (emphasis mine):
So we are indeed using a single CRLF before the boundary, and we're not bothered about the preamble ending with a line break, so this all checks out. I looked at some other clients - Apple Mail uses a blank line for the preamble:
Gmail doesn't use anything at all:
nor does Yahoo:
A boundary may be followed by a blank line, but this indicates that the MIME part has no headers at all. In short, if this is really the case, this is a bug in Outlook, however, adding an extra break in the preamble is harmless. Care to make a PR? |
PR #2009. |
Problem description
I believe there is missing one extra EOL in:
https://github.com/PHPMailer/PHPMailer/blob/master/src/PHPMailer.php#L2609
$mimepre = 'This is a multi-part message in MIME format.' . static::$LE;
The line should read properly:
$mimepre = 'This is a multi-part message in MIME format.' . static::$LE. static::$LE;
Missing extra LE causes, that when downloaded email like EML file, MS Outlook (tested at least 2010) will not recognize properly first boundary. So it will show up in plaintext. Once added extra line, it shows up properly HTML formatted.
Currently rendered raw output is:
correctly should be (not extra line before first boundary):
The line "This is a multi-part message in MIME format." has been added about 3 yrs ago (~2016) according to git-blame and before that there had been there also 2 EOLs which worked fine. I found this issue after upgrading from 5.2.9 to newest version 6.1.4.
The text was updated successfully, but these errors were encountered: