欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

outlook发送邮件:PHP 发送 outlook 约会邮件

程序员文章站 2022-04-27 12:00:19
...
  1. $to = "other@xxxx.net";
  2. $from = "me@xxxx.net";
  3. $subj = "my test subject";
  4. $msg = "this is the email body";
  5. $header = "From: " . $from . "\r\n" .
  6. "MIME-Version: 1.0\r\n" .
  7. "Content-Type: text/calendar;method=REQUEST";
  8. $txt_msg = "this is my text message, to be attached\r\n" .
  9. "not much to it, eh.";
  10. //Various ways to creat a new, random UID
  11. $cal_uid = "{" . uniqid(mt_rand(), true) . "}";
  12. $cal_uid = "{" . date('Ymd').'T'.date('His')."-".rand()."@mydomain.com}";
  13. $cal_uid = com_create_guid();
  14. $cal_msg =
  15. "BEGIN:VCALENDAR
  16. PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
  17. VERSION:2.0
  18. METHOD:REQUEST
  19. BEGIN:VEVENT
  20. ORGANIZER:MAILTO:name
  21. DTSTART:20090901T170000Z
  22. DTEND:20090901T035959Z
  23. UID:" . $cal_uid . "
  24. LOCATION:my meeting location
  25. TRANSP:OPAQUE
  26. SEQUENCE:0
  27. DTSTAMP:20060309T045649Z
  28. CATEGORIES:Meeting
  29. DESCRIPTION:meeting description, line 1 of 2.\nline 2 of 2.\n\n
  30. SUMMARY:meeting subject
  31. PRIORITY:5
  32. X-MICROSOFT-CDO-IMPORTANCE:1
  33. CLASS:PUBLIC
  34. BEGIN:VALARM
  35. TRIGGER:-PT3D
  36. ACTION:DISPLAY
  37. DESCRIPTION:Reminder
  38. END:VALARM
  39. BEGIN:VTIMEZONE
  40. TZID:US/Central
  41. END:VTIMEZONE
  42. END:VEVENT
  43. END:VCALENDAR";
  44. if (mail($to, $subj, $cal_msg, $header, "")) {
  45. echo "test email sent";
  46. } else {
  47. echo "test email failed";
  48. }
  49. ?>
本文链接http://www.cxybl.com/html/wlbc/Php/20130319/37246.html