8000 Mailer component and html() call -incompatible with simple_html_dom library ? · Issue #54732 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip 10000 to content
Mailer component and html() call -incompatible with simple_html_dom library ?  #54732
Closed
@simogeo

Description

@simogeo

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 ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0