diff --git a/src/Illuminate/Mail/Transport/ResendTransport.php b/src/Illuminate/Mail/Transport/ResendTransport.php index 0e690bf30b5a..9693eaf3a476 100644 --- a/src/Illuminate/Mail/Transport/ResendTransport.php +++ b/src/Illuminate/Mail/Transport/ResendTransport.php @@ -72,12 +72,19 @@ protected function doSend(SentMessage $message): void if ($email->getAttachments()) { foreach ($email->getAttachments() as $attachment) { $attachmentHeaders = $attachment->getPreparedHeaders(); + $contentType = $attachmentHeaders->get('Content-Type')->getBody(); $filename = $attachmentHeaders->getHeaderParameter('Content-Disposition', 'filename'); + if ($contentType == 'text/calendar') { + $content = $attachment->getBody(); + } else { + $content = str_replace("\r\n", '', $attachment->bodyToString()); + } + $item = [ - 'content_type' => $attachmentHeaders->get('Content-Type')->getBody(), - 'content' => str_replace("\r\n", '', $attachment->bodyToString()), + 'content_type' => $contentType, + 'content' => $content, 'filename' => $filename, ];