Skip to content

Commit 34cf2bf

Browse files
committed
fix addressing
1 parent 1d418fa commit 34cf2bf

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/Illuminate/Mail/Message.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(Email $message)
3737
*/
3838
public function from(string $address, ?string $name = null): self
3939
{
40-
$this->message->from(new Address($address, $name));
40+
$this->message->from(new Address($address, $name ?? ''));
4141
return $this;
4242
}
4343

@@ -70,7 +70,7 @@ public function returnPath(string $address): self
7070
/**
7171
* Add a recipient to the message.
7272
*
73-
* @param string|array $address
73+
* @param string|Address[] $address
7474
* @param ?string $name
7575
* @return $this
7676
*/
@@ -118,21 +118,21 @@ public function replyTo(string $address, ?string $name = null): self
118118
/**
119119
* Add a recipient to the message.
120120
*
121-
* @param string|array $address
121+
* @param string|Address[] $address
122122
* @param string $name
123123
* @param string $type
124124
* @return $this
125125
*/
126-
protected function addAddresses(string|array $address, string $name, string $type): self
126+
protected function addAddresses(string|array $address, ?string $name, string $type): self
127127
{
128128
if (is_array($address))
129129
{
130130
$type = lcfirst($type);
131-
$this->message->$type($address, $name);
131+
$this->message->$type($address);
132132
}
133133
else
134134
{
135-
$this->message->{"add{$type}"}($address, $name);
135+
$this->message->{"add{$type}"}(new Address($address, $name ?? ''));
136136
}
137137

138138
return $this;

0 commit comments

Comments
 (0)