Skip to content

MailerInterface::send does not return anything, but is stated in the docs #13062

Closed
@dsentker

Description

@dsentker

In the chapter Creating & Sending Messages, the example shows the usage of a return object from MailerInterface::send().

/** @var Symfony\Component\Mailer\SentMessage $sentEmail */
$sentEmail = $mailer->send($email);
// $messageId = $sentEmail->getMessageId();

This is wrong, because the MailerInterface is returning void.

interface MailerInterface
{
    /**
     * @throws TransportExceptionInterface
     */
    public function send(RawMessage $message, Envelope $envelope = null): void;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions