日期:2011-08-23  浏览次数:20427 次

  1. <?php 
  2. $to = "other@xxxx.net"
  3. $from = "me@xxxx.net"
  4. $subj = "my test subject"
  5. $msg = "this is the email body"
  6. $header = "From: " . $from . "\r\n" . 
  7. "MIME-Version: 1.0\r\n" . 
  8. "Content-Type: text/calendar;method=REQUEST"
  9. $txt_msg = "this is my text message, to be attached\r\n" . 
  10. "not much to it, eh."
  11. //Various ways to creat a new, random UID 
  12. $cal_uid = "{" . uniqid(mt_rand(), true) . "}"
  13. $cal_uid = "{" . date('Ymd').'T'.date('His')."-".rand()."@mydomain.com}"
  14. $cal_uid = com_create_guid(); 
  15. $cal_msg = 
  16. "BEGIN:VCALENDAR 
  17. PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN 
  18. VERSION:2.0 
  19. METHOD:REQUEST 
  20. BEGIN:VEVENT 
  21. ORGANIZER:MAILTO:name 
  22. DTSTART:20090901T170000Z 
  23. DTEND:20090901T035959Z 
  24. UID:" . $cal_uid . " 
  25. LOCATION:my meeting location 
  26. TRANSP:OPAQUE 
  27. SEQUENCE:0 
  28. DTSTAMP:20060309T045649Z 
  29. CATEGORIES:Meeting 
  30. DESCRIPTION:meeting description, line 1 of 2.\nline 2 of 2.\n\n 
  31. SUMMARY:meeting subject 
  32. PRIORITY:5 
  33. X-MICROSOFT-CDO-IMPORTANCE:1&n