I am trying to send calendar emails through Laravel, I had this working on Laravel 7 with the below code but, on Laravel 9 setContentType has been removed and setbody has been changed to html or text (meaning you can’t set the body content type to text/calendar).
I know the ics file is fine as this has not changed and is also an attachment that and that works.
I have tried using the addParameterizedHeader() function but that seems to make no difference.
Is there a way to do this?
Mail::send([], [], function($message) use($file,$entitySubject,$entityDesc,$custEmail,$userEmail,$userFullName){
$message->subject($entitySubject)->from($userEmail,$userFullName)->attach($file, array(
'as' => $file->getClientOriginalName(),
'mime' => "text/calendar"
)
);
$message->To($custEmail);
$message->setContentType("text/calendar");
$message->replyTo($userEmail,$userFullName);
$message->setbody(file_get_contents($file), "text/calendar; charset='utf-8'; method=REQUEST");