Skip to content

Commit

Permalink
[9.x] Bug fix: Use correct parameters to send email through SES via S…
Browse files Browse the repository at this point in the history
…esV2Client (#37881)

* use correct parameters for sending raw email via SES v2

* remove FromEmailAddress parameter
  • Loading branch information
fideloper authored Jul 2, 2021
1 parent fb33213 commit 8a1a7b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Illuminate/Mail/Transport/SesTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = nul
$result = $this->ses->sendEmail(
array_merge(
$this->options, [
'FromEmailAddress' => key($message->getSender() ?: $message->getFrom()),
'RawMessage' => [
'Data' => $message->toString(),
'Content' => [
'Raw' => ['Data' => $message->toString()],
],
]
)
Expand Down
5 changes: 3 additions & 2 deletions tests/Mail/MailSesTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public function testSend()
$client->expects($this->once())
->method('sendEmail')
->with($this->equalTo([
'FromEmailAddress' => 'myself@example.com',
'RawMessage' => ['Data' => (string) $message],
'Content' => [
'Raw' => ['Data' => (string) $message],
],
]))
->willReturn($sendRawEmailMock);

Expand Down

0 comments on commit 8a1a7b5

Please sign in to comment.