public function __construct(string
$id, EventDispatcherInterface
$dispatcher = null, LoggerInterface
$logger = null
) { parent::
__construct('smtp.mailpace.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->
addMailPaceHeaders($message);
} return parent::
send($message,
$envelope);
} private function addMailPaceHeaders(Message
$message): void
{ $headers =
$message->
getHeaders();
foreach ($headers->
all() as $name =>
$header) { if ($header instanceof TagHeader
) {