Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Mailer component and html() call -incompatible with simple_html_dom library ? #54732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
simogeo opened this issue Apr 25, 2024 · 0 comments
Closed

Comments

@simogeo
Copy link

simogeo commented Apr 25, 2024

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 ?

@simogeo simogeo added the Bug label Apr 25, 2024
@symfony symfony locked and limited conversation to collaborators Apr 25, 2024
@xabbuh xabbuh converted this issue into discussion #54733 Apr 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants