PHP sends Outlook appointment messages
Note: I haven't verified it yet, and I've seen it in a post.
?
? $to? = "[email protected]";?
? $from = "[email protected]";?
? $SUBJ = "my test subject";?
? $msg? = "This is the email body";?
?
? $header = "From:". $from. "\ r \ n".?
? ? ? ? ? "Mime-version:1.0\r\n".?
? ? ? ? ? ?" Content-type:text/calendar;method=request ";?
?
? $txt _msg = "This was my text message, to be attached\r\n".?
? ? ? ? ? ? ?" Not much to it, eh. ";?
?
? Various ways to creat a new, random UID?
? $cal _uid = "{". Uniqid (Mt_rand (), true). "}";?
? $cal _uid = "{". Date (' Ymd '). ' T '. Date (' his '). " -". Rand ()." @mydomain. com} ";?
? $cal _uid = Com_create_guid ();?
?
? $cal _msg =?
"Begin:vcalendar?"
Prodid:-//microsoft Corporation//outlook 11.0 mimedir//en?
Version:2.0?
Method:request?
Begin:vevent?
ORGANIZER:MAILTO:name?
dtstart:20090901t170000z?
dtend:20090901t035959z?
UID: ". $cal _uid. "
Location:my meeting Location?
Transp:opaque?
Sequence:0?
dtstamp:20060309t045649z?
Categories:meeting?
Description:meeting DESCRIPTION, line 1 of 2.\nline 2 of 2.\n\n?
Summary:meeting subject?
Priority:5?
X-microsoft-cdo-importance:1?
Class:public?
Begin:valarm?
TRIGGER:-P T3d?
Action:display?
Description:reminder?
End:valarm?
Begin:vtimezone?
Tzid:us/central?
End:vtimezone?
End:vevent?
End:vcalendar ";?
? if (Mail ($to, $SUBJ, $cal _msg, $header, "")) {?
? ? echo "test email sent";?
? } else {?
? ? echo "test email failed";?
? }?
??>