Skip to content
Advertisement

Attaching / Sending .ics event via email in php

I am having trouble trying to send an .ics file ‘meeting invitation’ via email.

I am using this class to quickly generate the contents of the .ics file: https://gist.github.com/jakebellacera/635416

The content generates correctly but I cannot get it to show as an attachment… so far only as string.

I have even tried to encode it but it just shows the encoded .ics content as a string.

Here is my code currently:

JavaScript

Commented out are some of the things I have tried… below is the current result from the autoreply email:

JavaScript

In the past I also tried mail->addAttachment() or ->addStringAttachment() but both of those calls break my code.

Here is what the non-encoded ics event looks like:

JavaScript

Any idea what the issue could be?? Many thanks ahead of time!

Advertisement

Answer

Ended up implementing PHPMailer and it worked liked a charm.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement