- <?php
- $to = "Other@xxxx.net";
- $from = "Me@xxxx.net";
- $SUBJ = "my test subject";
- $msg = "This are the email body";
- $header = "From:". $from. "\ r \ n".
- "Mime-version:1.0\r\n".
- "Content-type:text/calendar;method=request";
- $txt _msg = "This is the I text message, to be attached\r\n".
- "Not more 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";
- }
- ?>
This article links http://www.cxybl.com/html/wlbc/Php/20130319/37246.html