$this->
setSender($sender);
$this->
setRecipients($recipients);
} public static function create(RawMessage
$message): self
{ if (RawMessage::
class === $message::
class) { throw new LogicException('Cannot send a RawMessage instance without an explicit Envelope.'
);
} return new DelayedEnvelope($message);
} public function setSender(Address
$sender): void
{ // to ensure deliverability of bounce emails independent of UTF-8 capabilities of SMTP servers
if (!
preg_match('/^[^@\x80-\xFF]++@/',
$sender->
getAddress())) { throw new InvalidArgumentException(sprintf('Invalid sender "%s": non-ASCII characters not supported in local-part of email.',
$sender->
getAddress()));
} $this->sender =
$sender;
}