bug #36947 [Mime] Allow email message to have "To", "Cc", or "Bcc" header to be valid (Ernest Hymel)
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.
Discussion
----------
[Mime] Allow email message to have "To", "Cc", or "Bcc" header to be valid
| Q | A
| ------------- | ---
| Branch? | 5.0
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #36944
| License | MIT
| Doc PR | N/A
Allow emails to have any one of To:, Cc:, or Bcc: fields rather than forcing a required To: field.
Commits
-------
35b7e1cb9a
Allow email message to have "To", "Cc", or "Bcc" header to be valid
This commit is contained in:
commit
b524e04300
@ -122,8 +122,8 @@ class Message extends RawMessage
|
||||
|
||||
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')) {
|
||||
|
Reference in New Issue
Block a user