Problem/Motivation
My configurations:
- Drupal 10.0.7
- PHP 8.1.13
- Mimemail 8.x-1.0-alpha5
There is deprecated code in src/Utility/MimeMailFormatHelper.php. (line 452 and line 685).
https://www.drupal.org/node/3126004
This prevent the email from being sent. The module works when I replace the lines with guessMimeType().
Error: Call to undefined method Drupal\Core\ProxyClass\File\MimeType\MimeTypeGuesser::guess() in Drupal\mimemail\Utility\MimeMailFormatHelper::mimeMailFile() (line 452 of /web/modules/contrib/mimemail/src/Utility/MimeMailFormatHelper.php).
Proposed resolution
guess() needs to be replaced by guessMimeType()
Comments
Comment #2
tr commentedPlease help with #3155325: Improve image detection
Comment #3
mkalkbrennerI understand that this issue should be fixed together with #3155325: Improve image detection.
But that issue is not solved since months. So mimemail causes PHP fatal errors on Drupal 10.0 and 10.1 while it pretends to be compatible to Drupal ^10.
Therefore, I suggest to fix that fatal error first.
Comment #4
mkalkbrennerComment #5
tr commentedSo help solve that issue. Part of the problem is that there is not sufficient testing, which is why that other issue needs to be fixed and which is why a band-aid like you propose is not a sustainable solution for this module going forward.
Comment #6
leducdubleuet commented@mkalkbrenner
Thanks a lot for the band-aid in comment #4, it helps going forward while the other issue is worked on!
@TR
I'll have a look at that other issue to see if I can help.
Comment #7
leducdubleuet commented@TR
I understand that you want it clean with the testing and all but Drupal 9 is not supported anymore and we really need a functional D10 version of this module. It has been more than 8 months and no work has been done on the other issue #3155325: Improve image detection...
So I am asking if it would it be possible to release a D10 version even if the band-aid solution is not ideal please?
Comment #8
mkalkbrennerI totally agree with @LeDucDuBleuet
I re-open this issue to help others, because Drupal 9 reached EOL.
I also set the priority back to Critical, because mails aren't sent.
Comment #9
tidoCan you tell me if this issue will soon be included in the release?
I can confirm that sending emails with an attachment provided in #attachments fails if this patch is not present with Drupal 10.2.2 / PHP 8.2 / Mimemail 8.x-1.0-alpha6.
Comment #10
leducdubleuet commentedThis patch has been tested successfully for more than 6 months now on many websites, I can confirm it is RTBC.
@TR
It has been more than a year now, while not ideal, could we have a new release including this patch please?
Thank you very much.
Comment #11
leducdubleuet commentedWould it be possible to have this patch committed to 8.x-1.x-dev please?
Comment #13
mark_fullmerThanks, everyone! This has been committed and will be included in the upcoming 2.0.0-alpha2 release.