Swiftmailer - Corrupted HTML on receiving

Asked

Viewed 103 times

2

I am having problems with Swiftmailer when I send a message and sometimes I get complaints that the content is completely broken (HTML removed).

My software sends a lot of emails, and this problem happens almost every day, but we can’t get any log that has the reason. Since we are using Yii as our main framework and we use the log (and trace) tracking tool that presents the email correctly we cannot succeed in the reason for the problem.

To improve we changed part of the Swiftmailer code to perform line breaking before the strip_tags used by default in the msgHTML() method, the problem is that users are not seeing the text/Plain part of the email, but the HTML handled by the client (without any tag and all together).

Just one remark, we are using Relay to send via Outlook Exchange SMTP (port 25 and no authentication). We talked to the Microsoft support staff and they reported that this problem should be in our tool.

  • He even printed the output before sending the email to analyze if it really is broken ??

  • Yes, the content is perfect. html is well structured, which I thought could be one of the reasons why the problem happened.

  • 2

    I think it would be nice to put html also to help in the analysis, I never had problem with swiftmailer to corrupt html but it is good to see how it is and if this 100%

  • @Otto Follow the HTML we got in the log of an email that reported the problem, Pastebin link: HTML

  • Pastebin is blocked here in the company I see later this to try to help you

1 answer

1

Without seeing your code gets kind of hard, but I had a similar problem.

Was using so:

$html = $this->renderPartial('view',array(),true);

It was resolved by changing the renderPartial() for a render() with some adjustments:

$this->layout = 'layout-email';
$html = $this->render('view',array(),true);
$this->layout = 'layout-da-pagina';

Browser other questions tagged

You are not signed in. Login or sign up in order to post.