This latest update brought our site down due to the following file:

htmlmail.mail.inc

We need to comment out lines 61 - 71 to bring everything back:

// @todo Change to drupal_html_to_text when issue #299138 gets resolved.
      //$plain = mailsystem_html_to_text($body);
      //if ($body && !$plain) {
      //  watchdog(
      //    'htmlmail',
      //    'The %convert function did not return any text. Please report this error to the %mailsystem issue queue.',
      //    array('%convert' => 'mailsystem_html_to_text()', '%mailsystem' => 'Mail system'),
      //    WATCHDOG_WARNING,
      //    'http://drupal.org/node/add/project-issue/mailsystem'
      //  );
      //}

This would cause the following error in the logs:

Error: Call to undefined function mailsystem_html_to_text() in HTMLMailSystem->format() (line 62

I hope this helps.

Comments

glynster created an issue. See original summary.

salvis’s picture

Thank you for the quick reaction! I've added a warning to the snapshot and will investigate what happened.

Sorry about the trouble...

salvis’s picture

Status: Active » Postponed (maintainer needs more info)

Are you sure you didn't change anything else on your site? The code that you identified as offensive has not been affected by the recent changes...

What version did you have installed prior to updating?

glynster’s picture

We have been using the dev version for quite some time. Drupal update flagged this module for an update so we did. As this was so serious I just looked into the logs and this was the section that was causing grief for us. We do use SMTP to send and HTML to render. I have not seen any updates to SMTP recently. This did occur once we update the module for sure. Other modules we have updated would not have affected this.

Here is the error:

Error: Call to undefined function mailsystem_html_to_text() in HTMLMailSystem->format() (line 62 of /home/unnamed/subdomains/unnamed/sites/all/modules/htmlmail/htmlmail.mail.inc).

ParseError: syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) or const (T_CONST) in _registry_check_code() (line 74 of /home/unnamed/subdomains/unnamed/sites/all/modules/htmlmail/htmlmail.mail.inc).

Let me know what else I can supply.

glynster’s picture

Perhaps the second error is the key?

salvis’s picture

Which version of https://www.drupal.org/project/mailsystem are you using? Could it be that you changed from 7.x-2.x to 7.x-3.x?

The code that you commented out has been there for years without any problems...

glynster’s picture

There has not been any updates for ages, that said you are right we are using 7.x-3.x-dev. Seems to not have been updated since 2014. But why now after an update from your module. I guess something is outdated in that version causing the error to fall onto your module? I guess I need to downgrade to the dev 2 which is more current? What would you suggest?

salvis’s picture

So you're saying that you've haven't switched from 7.x-2.x to 7.x-3.x just the other day, but you've been using it all along, right?

Then I'm out of ideas. We have at least one user who does not experience the crash that you are seeing (#2848303-5: SMTP module breaks multipart structure when images are present.). Please revert to the version that you had installed before updating and see what happens—I'm pretty sure it has the same problem, unless it was patched, too.

glynster’s picture

Correct no updates at all as we have been using 7.x-3.x all along. We are also using PHP 7.1. We have reverted back to the dev version prior and all is working as usual. Let me know if there is anything else I can offer to help track down the issue.

glynster’s picture

OK not sure what to tell you but I have to assume there was some kind of OpCache at play here. We have the latest dev version running again in production and all is fine. Is very odd. I will keep monitoring but we should remove the critical as this is now something we cannot replicate. Sorry to have bothered you with this.

salvis’s picture

Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Strange things happen sometimes.

Thanks for following up and feel free to reopen if it pops up again.

Collins405’s picture

Priority: Normal » Major
Status: Closed (cannot reproduce) » Active

This is now happening with us.

We enabled HTML mail, and Mailsystem, and all webforms are now resulting in "The website has encountered an error".

Running on PHP 7.
HTML Mail 7.x-2.65
Mail System 7.x-3.0-alpha1

Error: Call to undefined function mailsystem_html_to_text() in HTMLMailSystem->format() (line 62 of /homepages/9/d629453478/htdocs/biolectricuk/sites/all/modules/contrib/htmlmail/htmlmail.mail.inc).

Collins405’s picture

We rolled back the Mail System module to version 7.x-2.34 and all was OK again.

There is obviously a compatibility with the new Mail System version.

salvis’s picture

Priority: Major » Normal
Status: Active » Closed (works as designed)

Issues are to be expected in alpha versions. Have you reported this to the Mail System queue?