Outlook sends mail: PHP sends Outlook appointment messages

Source: Internet
Author: User
Tags date header mail net version
 
 
  1. <?php
  2. $to = "Other@xxxx.net";
  3. $from = "Me@xxxx.net";
  4. $SUBJ = "my test subject";
  5. $msg = "This are 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 the I text message, to be attached\r\n".
  10. "Not more 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
  34. Class:public
  35. Begin:valarm
  36. TRIGGER:-P T3d
  37. Action:display
  38. Description:reminder
  39. End:valarm
  40. Begin:vtimezone
  41. Tzid:us/central
  42. End:vtimezone
  43. End:vevent
  44. End:vcalendar ";
  45. if (Mail ($to, $SUBJ, $cal _msg, $header, "")) {
  46. echo "test email sent";
  47. } else {
  48. echo "test email failed";
  49. }
  50. ?>
This article links http://www.cxybl.com/html/wlbc/Php/20130319/37246.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.