Hello, 

I manage a site that uses several webforms integrated with civicrm. I was using php 7.4 in the server but following the notices about deprecation of this version of php I have updated to 8.1.

After this change, the emails do not attach pdfs anymore and the email body isn't formatted as html.

I used Mime Mail to format and send emails. 

I have all modules and core updated, webform, civicrm, tcpdf, mimemail, etc.

The first lines of an emails shows, for example:

This is a multi-part message in MIME format.
--729d7c3ed8bc0bb58126c409c240f130fb3b8c1c1
Content-Type: multipart/alternative;
boundary="c911c97aed9baeb8ca3278e47d2959cf9e1fa99f0"
Content-Transfer-Encoding: 8bit
--c911c97aed9baeb8ca3278e47d2959cf9e1fa99f0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

 

Changing to default for delivery and formatting does not resolved problem.  The first lines are:

--------------adf9ba40a66c208e16502193edab401a
Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit

The server has the Mail Mime pear package. 

The status report show that php version is 8.1.28 and enabled packages are: date, dom, filter, gd, hash, json, pcre, pdo, session, SimpleXML, SPL, xml.

With this description, I could ask for any suggestion or advice to debug this problem and to find a solution.

Thanks!

Andrés

 

Comments

Andres, do you use the module mailsystem together with mimemail?

Also this may sound silly, but try fully uninstalling mimemail and reinstalling it, then checking the configurations again, and the ones in mailsystem if you use that.

Hello, 

I use mailsystem. I unistalled mimemail but do not solved the problem... 

Andrés

hmm.. try uninstalling and reinstalling both modules? 

So, what do you use to generate the PDF (or is it an uploaded file)? And how to do you attach the PDF? Are you using hook_mail with the parameter 'attachments'? Or is this handled by a contrib module?

I'm wondering if this is an issue with the tcpdf contrib module. There was a release 2 weeks ago for 8.1 compatibility. Do you have that?

mazze's picture

The same here after updating PHP version from 7.4 to 8.1. No HTML mail sent anymore (I am using MIME-Mail). I already tried uninstall/reinstall. The received mails start with

This is a multi-part message in MIME format. --d7b9738ca28a1d6caa7621abb76a2f3417d71e951 Content-Type: multipart/alternative; boundary="3a79b1cf24eed18d4328d05d0f8f504cba7dfba00" Content-Transfer-Encoding: 8bit --3a79b1cf24eed18d4328d05d0f8f504cba7dfba00 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit

Mailtext goes here...

Are you using mailsystem as well? I send lots of emails with pdf attachments using a combination of mailsystem, MIME mail and SMTP authentication in PHP 8.1 and have never experienced that issue. At times, the order in which you enable SMTP and MIME can "confuse" mailsystem - I've had to go back to mailsystem settings ui and fix that. 

Also, how do you attach PDFs? I use hook_mail for this. Any module in particular? 

EDIT: In my setup I use MIME mail to format and SMTP for send the email.

mazze's picture

Yes I use mailsystem and MIME, but not SMTP and no attachements at all. Maybe this is not the right thread here;-) But the HTML mails stop working as soon as I upgrade the PHP version to 8.x

Hmmm... interesting. I've always used SMPT to send HTML emails formatted by MIME mail, so this may actually prevented the issue for me. Perhaps create an issue in MIME mail issue queue?