PHP 發送 outlook 幽會郵件

來源:互聯網
上載者:User
PHP 發送 outlook 約會郵件

註:還沒驗證過,在一個文章中看到了

?

? $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 is 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:-PT3D?

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";?

? }?

? ?>

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.