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

6.2.0+ corrupts HTML body #3054

Closed
duzenko opened this issue May 7, 2024 · 5 comments
Closed

6.2.0+ corrupts HTML body #3054

duzenko opened this issue May 7, 2024 · 5 comments

Comments

@duzenko
Copy link

duzenko commented May 7, 2024

Problem description

I'm trying to upgrade dependencies for a legacy project
It's using PHPMailer v5 and all is good
I tried to upgrade to the latest version but some HTML emails are now corrupted
I narrowed it down to 6.2.0 which is the first version to exhibit this problem
6.1.8 was the last to send the HTML as is

Here's the diff between the email source as seen by the recipient server
image

I tried to debug it in the source code and can confirm that the call to the mail() function in \PHPMailer\PHPMailer\PHPMailer::mailPassthru still has the right content. However somewhere along the way some HTML tags are lost. Since 6.1.8 still sends it correctly I can't help but this this has to be header/configuration issue.

I don't have any ideas but maybe someone has reported this issue before and you may advise in which direction to look.

Here's my initialization:

		$mailer = new PHPMailer\PHPMailer\PHPMailer( true );
		$mailer->CharSet = 'UTF-8';
		$mailer->IsHTML();
/// per-email data
		$mailer->Send();
@duzenko

This comment was marked as abuse.

@duzenko

This comment was marked as abuse.

@duzenko

This comment was marked as abuse.

@duzenko duzenko closed this as completed May 7, 2024
@Synchro
Copy link
Member

Synchro commented May 7, 2024

So. umm, why dropped support for legacy Linux senders? Should have at least mentioned it in the release notes

That didn't happen; nothing was dropped, and this change was explicitly mentioned in the release notes, to quote:

Resolve PHP 8 line break issues due to a very old PHP bug being fixed

PHP 8.0 fixed a bug relating to the use of line breaks in the mail transport, which meant that PHPMailer's workaround code was broken, and it caused double line breaks in PHP 8 versions running on Linux, which was fixed in that version. Anything running PHP older than PHP 8.0 (i.e. legacy code) would be unaffected, as you can see in the code.

@duzenko

This comment was marked as abuse.

@PHPMailer PHPMailer locked and limited conversation to collaborators May 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants