Jump to content

PHP Send Outlook invitation and blockCalendar


FooKelvin

Recommended Posts

Yes it is possible you have send the email containing vCalander meta data.

 

I found a few tutorials/discussions/code snippets by googling the term "php outlook send calendar invite"

 

Hello, I try to use this codes, but i didn't receive any email or appointment.

// How to create outlook meeting request with PHP
// If you don't use exchange server, the message arrives as ics attachment.
 
<?php
 
    $to = 'kelvinfoodumb@gmail.com';
    $subject = "Millennium Falcon";
     
    $organizer          = 'Darth Vader';
    $organizer_email    = 'darthvader@arturito.net';
     
    $participant_name_1 = 'Kelvin';
    $participant_email_1= 'kelvinfoodumb@gmail.com';
    
    $location           = "Stardestroyer-013";
    $date               = '20151215';
    $startTime          = '0800';
    $endTime            = '0900';
    $subject            = 'Millennium Falcon';
    $desc               = 'The purpose of the meeting is to discuss the capture of Millennium Falcon and its crew.';
 
    $headers = 'Content-Type:text/calendar; Content-Disposition: inline; charset=utf-8;\r\n';
    $headers .= "Content-Type: text/plain;charset=\"utf-8\"\r\n"; #EDIT: TYPO
 
    $message = "BEGIN:VCALENDAR\r\n
    VERSION:2.0\r\n
    PRODID:-//Deathstar-mailer//theforce/NONSGML v1.0//EN\r\n
    METHOD:REQUEST\r\n
    BEGIN:VEVENT\r\n
    UID:" . md5(uniqid(mt_rand(), true)) . "example.com\r\n
    DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z\r\n
    DTSTART:".$date."T".$startTime."00Z\r\n
    DTEND:".$date."T".$endTime."00Z\r\n
    SUMMARY:".$subject."\r\n
    ORGANIZER;CN=".$organizer.":mailto:".$organizer_email."\r\n
    LOCATION:".$location."\r\n
    DESCRIPTION:".$desc."\r\n
    ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN".$participant_name_1.";X-NUM-GUESTS=0:MAILTO:".$participant_email_1."\r\n
    END:VEVENT\r\n
    END:VCALENDAR\r\n";
 
    $headers .= $message;
    mail($to, $subject, $message, $headers);    
?>   

The Original post is here.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.