Skip to content

Commit

Permalink
Allow email message to have "To", "Cc", or "Bcc" header to be valid
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest Hymel authored and fabpot committed May 25, 2020
1 parent a6061c5 commit 2adc530
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 2adc530

Please sign in to comment.