From 2adc53069becd0de3ea2748438646610ad0968db Mon Sep 17 00:00:00 2001 From: Ernest Hymel Date: Sun, 24 May 2020 11:54:18 -0500 Subject: [PATCH] Allow email message to have "To", "Cc", or "Bcc" header to be valid --- Message.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Message.php b/Message.php index 94a4976..b7ddb76 100644 --- a/Message.php +++ b/Message.php @@ -122,8 +122,8 @@ public function toIterable(): iterable public function ensureValidity() { - if (!$this->headers->has('To')) { - throw new LogicException('An email must have a "To" header.'); + if (!$this->headers->has('To') && !$this->headers->has('Cc') && !$this->headers->has('Bcc')) { + throw new LogicException('An email must have a "To", "Cc", or "Bcc" header.'); } if (!$this->headers->has('From') && !$this->headers->has('Sender')) {