PHP - 为邮件添加ical附件

I'm making a basic php reservation system. (see code below) I want to make the reservation + make an iCal attachement of it and send the mail. But for some reason my attachement is not being made and just outputted as normal text in the email.

FYI: some tags like are just to blank out my mail or phone for example. Not going to post it here :)

PHP Code

<?php

    $message = "";
    $datum = "";

    //email adres
    $email = "<email>";

    $required = array('dag', 'maand', 'jaar', 'uur', 'minuten', 'naam','email', 'telefoon', 'aantal', 'bericht', 'type');

    if (isset($_POST['reserveren']))
    {
        $data = $_POST['reservatie'];

        $headers = "";

        $message .= "Dag Lode en Eva, via de website kregen jullie een nieuwe reservatie, gelieve de persoon zo snel mogelijk een bevestigingsmail te sturen!";
        $message .= "

";
        $message .= $data['bericht'];
        $message .= "

";

        $message .= "Telefoon: " . $data['telefoon'];
        $message .= "

";
        $message .= "Lunch/Diner: " . $data['type'];
        $message .= "

"; 
        $message .= "Aantal personen: " . $data['aantal'];
        $message .= "

";
        $message .= "Email: " . $data['email'];
        $message .= "

";

        $message .= "Datum: " . $data['dag'];
        $message .= "

";
        $message .= "Maand: " . $data['maand'];
        $message .= " " . $data['jaar'];
        $message .= "

";
        $message .= "Tijdstip: " . $data['uur'] . " " . $data['minuten'];       
        $message .= "

";

        $naam = $data['naam'];
        $datum = $data['dag'] ."/". "1" ."/". $data['jaar']; 
        $mail = $data['email'];
        $plaats = "Baronie";
        $omschrijving = "reservering";

        //Create ICAL Content
        $ical =    'BEGIN:VCALENDAR
        PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
        VERSION:2.0
        METHOD:PUBLISH
        BEGIN:VEVENT
        ORGANIZER:MAILTO:'.$mail.'
        DTSTART:'.$datum.'
        LOCATION:'.$plaats.'
        TRANSP:OPAQUE
        SEQUENCE:0
        DESCRIPTION:'.$omschrijving.'
        SUMMARY:'.$subject.'
        PRIORITY:5
        CLASS:PUBLIC
        END:VEVENT
        END:VCALENDAR';   

        $message .= 'Content-Type: text/calendar;name="reservering.ics";method=REQUEST
';
        $message .= "Content-Transfer-Encoding: 8bit

";
        $message .= $ical;

        $subject = 'Nieuwe reservatie via de website';
        $headers = 'From: '. $data['email']. "
" .'Reply-To: '. $data['email']. "
" .'X-Mailer: PHP/' . phpversion();

        mail($email, $subject, $message, $headers);

        echo "mail verstuurd!";

    }
?>

Email output

Dag Lode en Eva, via de website kregen jullie een nieuwe reservatie, gelieve de persoon zo snel mogelijk een bevestigingsmail te sturen!

met cal

Telefoon: <phone>

Lunch/Diner: Diner

Aantal personen: 10

Email: <mail>

Datum: 01

Maand: Januari 2015

Tijdstip: 12 00

Content-Type: text/calendar;name="reservering.ics";method=REQUEST
Content-Transfer-Encoding: 8bit

BEGIN:VCALENDAR
        PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
        VERSION:2.0
        METHOD:PUBLISH
        BEGIN:VEVENT
        ORGANIZER:MAILTO:<my email address here>
        DTSTART:01/1/2015
        LOCATION:Baronie
        TRANSP:OPAQUE
        SEQUENCE:0
        DESCRIPTION:reservering
        SUMMARY:
        PRIORITY:5
        CLASS:PUBLIC
        END:VEVENT
        END:VCALENDAR

Thanks in advance!

Kind Regards!

Assuming PHPMailer is ok, the following should to the job. Please note i stripped it down a litte bit, but i think the Code should be easy enough to understand it.

<?php

//Of course, you can even include PHPmailer class directly!
require 'vendor/autoload.php';
define('CRLF',"
");

//do your processing here - assuming the variables are filled as follows:
$from='some@mail.address';
$to='some@persons.address';
$subject='someSubject';
$message='Hello World!';

$starttime=time();  //note that you need to supply a unix timestamp here!
$endtime=time()+3600;

//of course assuming the variables used in the attachments are accordingly set
$attachment='BEGIN:VCALENDAR'.CRLF.
            'VERSION:2.0'.CRLF.
            'PRODID:-//question_on//stackoverflow.com//EN'.CRLF.
            'BEGIN:VEVENT'.CRLF.
            'UID:'.md5(uniqid()).CRLF.
            'DTSTAMP:'.date('Ymd')."T".date('His').CRLF.
            'DTSTART:'.date('Ymd',$starttime)."T".date('His',$starttime).CRLF.
            'DTEND:'.date('Ymd',$endtime)."T".date('His',$endtime).CRLF.
            'LOCATION:somewhere'.CRLF.
            'DESCRIPTION:Some Description, if it should be multiline\,'.CRLF.
            '    the following lines need to be indentend by a single tab'.CRLF.
            'SUMMARY:test Event'.CRLF.
            'PRIORITY:5'.CRLF.
            'END:VEVENT'.CRLF.
            'END:VCALENDAR'.CRLF;
$mail = new PHPMailer;
$mail->From = $from;
$mail->addAddress($to);
$mail->isMail();
/*
If you later decide to use smtp instead of php's mail-function, just use the following lines
instead of 'isMail()'
$mail->isSMTP();
$mail->Host = 'mail.youmailprovider.com';
$mail->SMTPAuth = true;
$mail->Username = 'yourSMTPUser';
$mail->Password = 'password';
*/
$mail->Subject = $subject;
$mail->addStringAttachment($attachment,'filename_to_show.ics','base64','text/calendar');
$mail->Body=$message;

if(!$mail->send()) {
    echo "Mailer Error: " . $mail->ErrorInfo;
} else {
    echo  "Message sent!";
}