public function __construct(string
$id, EventDispatcherInterface
$dispatcher = null, LoggerInterface
$logger = null
) { parent::
__construct('smtp.ohmysmtp.com', 587, false,
$dispatcher,
$logger);
$this->
setUsername($id);
$this->
setPassword($id);
} public function send(RawMessage
$message, Envelope
$envelope = null
): ?SentMessage
{ if ($message instanceof Message
) { $this->
addOhMySmtpHeaders($message);
} return parent::
send($message,
$envelope);
} private function addOhMySmtpHeaders(Message
$message): void
{ $headers =
$message->
getHeaders();
foreach ($headers->
all() as $name =>
$header) { if ($header instanceof TagHeader
) {