Description
Symfony version(s) affected
5.4.38
Description
I'm trying to switch from swiftMailer to symfony/mailer used as external library ( I don't use symfony)
Everything works well except when I send html manipulated with simple_html_dom
library, I get the following error :
Fatal error: Uncaught TypeError: The body must be a string, a resource or null (got "simple_html_dom"). in lib/comp-vendor/symfony/mime/Email.php:321 Stack trace: #0 mail/send.php(127): Symfony\Component\Mime\Email->html() #1 plugins/l21_emailSuite/index.php(46): send_email() #2 plugins/index.php(56): include_once('...') #3 templates/admin/2021/index.php(72): include_once('...') #4 admin/index.php(74): include_once('...') #5 {main} thrown in lib/comp-vendor/symfony/mime/Email.php on line 321
When I pass the
If I send row html (with no simple_html_dom
library anterior manipulation, I do not experience any issue ... I guesse this is related to mime type ... but I'm stuck. Do you have any clue ?
Thanks in advance,
How to reproduce
- prepare a mail with html content using symfony/mailer
- do manipulate html content with
simple_html_dom
library available at http://sourceforge.net/projects/simplehtmldom/ - try to send the mail, it will trigger an error similar to the one provided above
Possible Solution
No response
Additional Context
I know simple_html_dom
is an old library ! but quite useful ... should symfony/mailer be more permissive ?