I am sending a calendar invitation using the Larvel mail api.
The calendar looks great in gmail, but shows an attachment in Outlook instead of the correct calendar invitation.
Gmail output:

, while in appearance it looks like affection:

I create a file called invite.ics and I put the contents in the invitation file. I attach the file when sending a message.
$to = $row->to; $subject = $row->subject; $attachments = $row->attachment; $cc = $row->cc; $body = $row->body; $calendar_invitation = $row->calendar_invitation; \Mail::send( 'emailTemplates.dummy', ['emailBody'=>$row->body], function(Message $message) use ($to,$subject,$attachments,$cc, $body, $calendar_invitation, $companyEmail) { $message->from($companyEmail, ''); $message->replyTo($companyEmail, 'Email Agent Evmeetings'); $message->to($to, '')->subject($subject); $file = fopen("invite.ics","w"); echo fwrite($file,$calendar_invitation); fclose($file); $message->attach('invite.ics', array('mime' => "text/calendar")); });
php outlook calendar laravel-5
Danyal sandeelo
source share