Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afe2c27 commit a5e4659Copy full SHA for a5e4659
src/Symfony/Component/Mime/Message.php
@@ -140,7 +140,10 @@ public function generateMessageId(): string
140
if ($this->headers->has('Sender')) {
141
$sender = $this->headers->get('Sender')->getAddress();
142
} elseif ($this->headers->has('From')) {
143
- $sender = $this->headers->get('From')->getAddresses()[0];
+ if (empty($froms = $this->headers->get('From')->getAddresses())) {
144
+ throw new LogicException('Your email has a From header but no addresses. Did you forgot to add emails in the "from" method ?');
145
+ }
146
+ $sender = $froms[0];
147
} else {
148
throw new LogicException('An email must have a "From" or a "Sender" header.');
149
}
0 commit comments