From 8a1a7b526419768256dfafc2f790c94618a906d0 Mon Sep 17 00:00:00 2001 From: Chris Fidao Date: Fri, 2 Jul 2021 11:41:03 -0500 Subject: [PATCH] [9.x] Bug fix: Use correct parameters to send email through SES via SesV2Client (#37881) * use correct parameters for sending raw email via SES v2 * remove FromEmailAddress parameter --- src/Illuminate/Mail/Transport/SesTransport.php | 5 ++--- tests/Mail/MailSesTransportTest.php | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Mail/Transport/SesTransport.php b/src/Illuminate/Mail/Transport/SesTransport.php index 964fecb8878d..cae80810fd20 100644 --- a/src/Illuminate/Mail/Transport/SesTransport.php +++ b/src/Illuminate/Mail/Transport/SesTransport.php @@ -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()], ], ] ) diff --git a/tests/Mail/MailSesTransportTest.php b/tests/Mail/MailSesTransportTest.php index a02b0152ca46..c08110ffdb73 100644 --- a/tests/Mail/MailSesTransportTest.php +++ b/tests/Mail/MailSesTransportTest.php @@ -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);