HTML in email responses is not rendered anymore

Created on 10 May 2023, over 1 year ago
Updated 4 August 2023, over 1 year ago

Problem/Motivation

I had several webforms where an email response follows the form submission. A HTML body was already set for the response and it worked as expected in the received messages. I recently set up another similar webform and discovered in the received message I could simply read the HTML tags. I tried with some of the already set up webforms and I faced the same problem. Now I'm resorting to plain text to workaround the issue.

Steps to reproduce

Set up a webform where an email response follows a submission and check Send email as HTML in the advanced configuration for the handler. In the received message HTML tags should be visible.

I have no idea about where the issue originated from, and I suspect it might be a local problem, that is I'm not sure it can be reproduced elsewhere. The only important change it's worth to mention is the upgrade from Drupal 8 to Drupal 9.

Thanks in advance!

Andrea

🐛 Bug report
Status

Closed: duplicate

Version

6.1

Component

Code

Created by

🇮🇹Italy AppLEaDaY

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @AppLEaDaY
  • Is the site using a contributed mailer module?

  • 🇮🇹Italy AppLEaDaY

    @cilefen, I was uncertain in interpreting "contributed mailer module", though I had some ideas.
    I searched "mail" and "smtp" in /admin/config and in /admin/modules and found no match.

  • Status changed to Postponed: needs info over 1 year ago
  • What aspect of that site changed?

    • Did you change the Webform version?
    • Did you change a contributed mailer version?
    • Did you change the Drupal core version?

    Can we please see the raw email with headers? This is something you should examine as part of reporting a bug.

    This could be 🐛 PhpMail : broken mail headers in PHP 8.0+ because of LF characters Fixed

  • Status changed to Active over 1 year ago
  • 🇮🇹Italy AppLEaDaY

    @cilefen I suppose things have been working fine as long as the website was running on an old 8 core. I first upgraded to a 8.9.20 and then to the latest 9 core available at that moment. As for the version of Webform, considering the core version I started from was likely below 8.8, I can deduce it may have been upgraded quite a lot ahead to arrive at 6.1.4 - composer did the job.

    As for the contributed mailer, I asked Chat GPT "what is a contributed mailer for drupal?" and by the answer I got I deduced I'm not using a contributed mailer.

    I operate in a shared hosting environment. Perhaps it's worth mentioning I likely changed the version of the php interpreter, I suppose at the time of the old core version I supposed the php version was 7.3 or 7.4, with the upgrade of the core I chose php 8.1.

    I'm attaching the raw text of a message I received with HTML not interpreted by the browser - I'm referring to the gmail interface.

  • Status changed to Closed: cannot reproduce over 1 year ago
  • 🇺🇸United States jrockowitz Brooklyn, NY

    I suspect this is more related to the email handling module or configuration, and we won't be able to reproduce the issues and help fix this.

  • 🇮🇹Italy AppLEaDaY

    @jrockowitz, is there then rather another area where I can ask for support, I mean excluding Webform? I mean where can I get support with email handling module?
    Thanks!

  • https://www.drupal.org/project/ideas/issues/3366039 Make it easy for site builders to send HTML formatted emails Closed: duplicate and are you on Slack?

  • 🇮🇹Italy AppLEaDaY

    @cilefen, do you mean I may overcome the problem I faced by installing a contributed module like "HTML Mail" or "Swift Mailer"?
    What Slack channel should I refer to?
    Thanks!

  • Yes.

    #support (probably, if about Drupal in general) or #webform (if webform-specific)

  • 🇮🇹Italy AppLEaDaY

    @cilefen, as for Slack, I remember in the past I used one or more specific chats, though I see here we are mentioning just channels. I consulted ChatGPT, please look at the related screenshot. Apparently I need an invitation to an area, don't I?

  • 🇺🇸United States tr Cascadia

    This is a symptom of the core issue 🐛 PhpMail : broken mail headers in PHP 8.0+ because of LF characters Fixed , where core has always used \n to terminate header lines instead of the RFC mandated \r\n. Because PHP 8 is now enforcing the correct line terminators, the \n is seen as whitespace, not a line terminator, so all
    headers appear on one line instead of one per line. When the headers get wrapped like this, the "Content-Type: text/html" header gets hidden from the mail client as it is not at the beginning of a header line, so the mail body is not properly interpreted as HTML.

  • 🇮🇹Italy AppLEaDaY

    Many thanks, TR! Your contribution was providential.

  • Status changed to Fixed over 1 year ago
  • Status changed to Closed: duplicate over 1 year ago
  • I gave the same information three months ago. Anyway this is technically a duplicate.

Production build 0.71.5 2024