使用 iCal 发送电子邮件到带有 valarm 提醒的 Outlook [英] Sent email with iCal to outlook with valarm reminder

查看:30
本文介绍了使用 iCal 发送电子邮件到带有 valarm 提醒的 Outlook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将带有 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 日历,但提醒设置为 15 分钟(Outlook 中的默认值),即使我在 VALARM 中设置了不同的值.

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

";
    $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("YmdTHis",$meeting_stamp);
    $dtend= GMDATE("YmdTHis",$meeting_stamp+$meeting_duration);

    $mime_boundary = "----Meeting Booking----".MD5(TIME());

    //Create ICAL Content
    $ical = 'BEGIN:VCALENDAR' . "
" .
        'PRODID:-//Patient Portal//MyEyeDr.//EN' . "
" .
        'VERSION:2.0' . "
" .
        'METHOD:REQUEST' . "
" .
        'BEGIN:VEVENT' . "
" .
        'ORGANIZER;CN="'.$from_name.'":MAILTO:'.$from_address. "
" .
        'ATTENDEE;CN="'.$to_name.'";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:'.$to_address. "
" .
        'LAST-MODIFIED:' . date("YmdTGis") . "
" .
        'UID:'.date("YmdTGis", strtotime($meeting_date)).rand()."@".$domain."
" .
        'DTSTAMP:'.date("YmdTGis"). "
" .
        'DTSTART;TZID="America/New_York":'.$dtstart. "
" .
        'DTEND;TZID="EAmerica/New_York":'.$dtend. "
" .
        'SEQUENCE:1'. "
" .
        'SUMMARY:' . $subject . "
" .
        'LOCATION:' . $meeting_location . "
" .
        'CLASS:PUBLIC'. "
" .
        'PRIORITY:5'. "
" .
        'BEGIN:VALARM'. "
" .
        'ACTION:Display'. "
" .
        'DESCRIPTION:'.$meeting_description. "
" .
        'SUMMARY:Event Alarm'. "
" .
        'TRIGGER:-PT120M'. "
" .
        'END:VALARM'. "
" .
        'END:VEVENT'. "
" .
        'END:VCALENDAR'. "
";

    $message= "To: ".$to_address."
";
    $message.= "From: ".$from_address."
";
    $message.= "Subject: Example SES mail (raw)
";
    $message.= "MIME-Version: 1.0
";
    $message .= "Content-Type: multipart/alternative; boundary="$mime_boundary"
";
    $message .= "Content-class: urn:content-classes:calendarmessage
";
    $message.= "

";
    $message .= "--$mime_boundary
";
    $message .= "Content-Type: text/html; charset=UTF-8
";
    $message .= "Content-Transfer-Encoding: 8bit

";
    $message .= "<html>
";
    $message .= "<body>
";
    $message .= '<p>Dear ...,</p>';
    $message .= '<p>This is an email message.</p>';
    $message .= "</body>
";
    $message .= "</html>
";
    $message .= "--$mime_boundary
";
    $message .= 'Content-Type: text/calendar;name="meeting.ics";method=REQUEST'."
";
    $message .= "Content-Transfer-Encoding: 8bit

";
    $message .= "X-Mailer: Microsoft Office Outlook 15.0
";
    $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 提醒的 Outlook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆