$body = new TextPart('Some content'); $headers = (new Headers()) ->addMailboxListHeader('From', ['[email protected]']) ->addMailboxListHeader('To', ['[email protected]']) ->AddTextHeader('Subject', 'Some subject') ; $email = new Message($headers, $body); And you get full control!
$this->transport = $transport; } public function __invoke(EnvelopedMessage $message) { $this->transport->send($message->getMessage(), $message->getEnvelope()); } } <service id="mailer.messenger.message_handler" class="Symfony\Component\Mailer\Messenger\MessageHandler" public="false"> <argument type="service" id="mailer.transport" /> <tag name="messenger.message_handler" /> </service> Here is the magic that makes it work!
CSS selector Event Dispatcher Dependency Injection Container Symfony Polyfills (punycode, intl, …) … with all the great features you love in Swiftmailer 6 Symfony Mailer