Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Mailer] Unable to send email with only attachment part #32811

Closed
@srsbiz

Description

@srsbiz

Symfony version(s) affected: 4.3.3

Description
Current logic
https://github.com/symfony/mime/blob/c71b839cc39d446f14afaef771c16f221d85c331/Email.php#L424
requires to have either text or html part before adding attachment part
https://github.com/symfony/mime/blob/c71b839cc39d446f14afaef771c16f221d85c331/Email.php#L443
which effectively prevents sending email message with only attachments.

How to reproduce

$email = (new Email())
    ->to('[email protected]')
    ->subject('See attached file')
    ->attachFromPath(__FILE__, 'test.php')
;

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