Skip to content

Commit 2adc530

Browse files
Ernest Hymelfabpot
authored andcommitted
Allow email message to have "To", "Cc", or "Bcc" header to be valid
1 parent a6061c5 commit 2adc530

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Message.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ public function toIterable(): iterable
122122

123123
public function ensureValidity()
124124
{
125-
if (!$this->headers->has('To')) {
126-
throw new LogicException('An email must have a "To" header.');
125+
if (!$this->headers->has('To') && !$this->headers->has('Cc') && !$this->headers->has('Bcc')) {
126+
throw new LogicException('An email must have a "To", "Cc", or "Bcc" header.');
127127
}
128128

129129
if (!$this->headers->has('From') && !$this->headers->has('Sender')) {

0 commit comments

Comments
 (0)