发送电子邮件与iCal展望与valarm提醒 [英] Sent email with iCal to outlook with valarm reminder
问题描述
我处于一种情况,我想通过iCal附件发送电子邮件到Outlook日历,我想在开始事件之前将提醒设置为120分钟。
I am in a situation where I want to send email with iCal attachment to Outlook Calendar and I want to set reminder to 120 minutes before start event.
我用iCal发送RAW消息(见下文)。
如果收件人打开邮件,事件将自动添加到Outlook日历中,但即使在VALARM中设置了不同的值,提醒也将设置为15分钟(默认为outlook)。
I send RAW message with iCal(see below). If recipient opens the message, event is automatically added to outlook calendar, but reminder is set to 15 minutes(default in outlook), even if I set different value in VALARM.
如果我使用iCal的ics文件导入Outlook日历,那么提醒设置为我的价值。
If I use ics file with iCal to import to Outlook Calendar then reminder is set to my value.
我真的很感激你的帮助。如何设置事件的提醒?
I would really appreciate help on this. How to set reminder for event?
$from_name = "<FROM_NAME>";
$from_address = "<FROM_ADDRESS>";
$subject = "Meeting Booking";
$meeting_description = "Here is a brief description of my meeting\n\n";
$meeting_location = "My Office";
$domain = 'domain.com';
$to_name = "<TO_NAME>";
$to_address = "<TO_ADDRESS>";
$meeting_date = "2015-10-21 15:40:00";
$meeting_duration = 3600;
$meeting_stamp = STRTOTIME($meeting_date . " UTC");
$dtstart= GMDATE("Ymd\THis\Z",$meeting_stamp);
$dtend= GMDATE("Ymd\THis\Z",$meeting_stamp+$meeting_duration);
$mime_boundary = "----Meeting Booking----".MD5(TIME());
//Create ICAL Content
$ical = 'BEGIN:VCALENDAR' . "\r\n" .
'PRODID:-//Patient Portal//MyEyeDr.//EN' . "\r\n" .
'VERSION:2.0' . "\r\n" .
'METHOD:REQUEST' . "\r\n" .
'BEGIN:VEVENT' . "\r\n" .
'ORGANIZER;CN="'.$from_name.'":MAILTO:'.$from_address. "\r\n" .
'ATTENDEE;CN="'.$to_name.'";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:'.$to_address. "\r\n" .
'LAST-MODIFIED:' . date("Ymd\TGis") . "\r\n" .
'UID:'.date("Ymd\TGis", strtotime($meeting_date)).rand()."@".$domain."\r\n" .
'DTSTAMP:'.date("Ymd\TGis"). "\r\n" .
'DTSTART;TZID="America/New_York":'.$dtstart. "\r\n" .
'DTEND;TZID="EAmerica/New_York":'.$dtend. "\r\n" .
'SEQUENCE:1'. "\r\n" .
'SUMMARY:' . $subject . "\r\n" .
'LOCATION:' . $meeting_location . "\r\n" .
'CLASS:PUBLIC'. "\r\n" .
'PRIORITY:5'. "\r\n" .
'BEGIN:VALARM'. "\r\n" .
'ACTION:Display'. "\r\n" .
'DESCRIPTION:'.$meeting_description. "\r\n" .
'SUMMARY:Event Alarm'. "\r\n" .
'TRIGGER:-PT120M'. "\r\n" .
'END:VALARM'. "\r\n" .
'END:VEVENT'. "\r\n" .
'END:VCALENDAR'. "\r\n";
$message= "To: ".$to_address."\n";
$message.= "From: ".$from_address."\n";
$message.= "Subject: Example SES mail (raw)\n";
$message.= "MIME-Version: 1.0\n";
$message .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n";
$message .= "Content-class: urn:content-classes:calendarmessage\n";
$message.= "\n\n";
$message .= "--$mime_boundary\r\n";
$message .= "Content-Type: text/html; charset=UTF-8\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= "<html>\n";
$message .= "<body>\n";
$message .= '<p>Dear ...,</p>';
$message .= '<p>This is an email message.</p>';
$message .= "</body>\n";
$message .= "</html>\n";
$message .= "--$mime_boundary\r\n";
$message .= 'Content-Type: text/calendar;name="meeting.ics";method=REQUEST'."\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= "X-Mailer: Microsoft Office Outlook 15.0\r\n";
$message .= $ical;
推荐答案
我认为您的代码没有任何错误。大多数日历客户端将忽略与邀请一起发送的任何闹钟。当你想到这一点,这是有道理的:如果你邀请我,我可能想接受或拒绝,但是你不应该在通知我什么时候通知。
I think there is nothing wrong with your code. Most calendar clients will ignore any alarm that is sent along with an invitation. When you think about it, this makes sense: if you invite me, I may want to accept or decline, but you should not dictate when I want to be notified.
另一方面,在导入时,您将自己做这些事件。
On the other hand, when importing, you are making those events your own.
这篇关于发送电子邮件与iCal展望与valarm提醒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!