【问题标题】:Outlook appointment with rails带导轨的 Outlook 约会
【发布时间】:2014-06-02 00:45:31
【问题描述】:

我正在尝试将约会从 ruby​​ (rails) 发送到 Microsoft Outlook 2013。
当我在附件中发送 ICS 文件时,用户必须手动打开该文件。
正在寻找一种发送正常会议请求的方法(用户无需打开 ICS 即可接受)。

我读了教程:http://knaveofdiamonds.com/post/50689213/sending-outlook-appointments-with-ruby 但它对我不起作用,用户收到以下电子邮件:

--
Date: Tue, 27 May 2014 23:17:23 +0300
Message-ID: <5384f2d3b125b_90c30357c28514@Eric-PC.mail>
Mime-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: base64
Content-Disposition: inline

QSBSdWJ5IGNyZWF0ZWQgYXBwb2ludG1lbnQ=

--
Date: Tue, 27 May 2014 23:17:23 +0300
Message-ID: <5384f2d3b1e13_90c30357c2861e@Eric-PC.mail>
Mime-Version: 1.0
Content-Type: text/calendar;
 charset=UTF-8;
 method=request;
 name=subject.ics
Content-Transfer-Encoding: quoted-printable
content-class: urn:content-classes:calendarmessage

BEGIN:VCALENDAR
VERSION:2.0
PRODID:icalendar-ruby
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20140527T201722Z
UID:abb15328-a6af-4c95-8e04-acdb9d6584e2
DTSTART:20140623T083000
DTEND:20140624T083000
CLASS:PRIVATE
DESCRIPTION:Have a long lunch meeting and decide nothing...
SUMMARY:Meeting with the man.
END:VEVENT
END:VCALENDAR

这是我的红宝石代码

cal = Icalendar::Calendar.new
cal.event do |e|
  e.dtstart     = DateTime.civil(2014, 6, 23, 8, 30)
  e.dtend       = DateTime.civil(2014, 6, 24, 8, 30)
  e.summary     = "Meeting with the man."
  e.description = "Have a long lunch meeting and decide nothing..."
  e.ip_class    = "PRIVATE"
  e.uid         = SecureRandom.uuid
end

Mail.defaults do
  delivery_method :smtp, options
end

mail = Mail.new
mail.mime_version = "1.0"
mail.body = cal.to_ical
mail.from = 'ericfeldman93@gmail.com'
mail.to = 'ericfeldman93@gmail.com'
mail.subject = 'bla'
mail.content_type = "text/calendar"

mail.deliver

有什么想法吗?

【问题讨论】:

    标签: ruby-on-rails ruby outlook


    【解决方案1】:

    您不应将 ICS 文件作为附件发送。您的整个消息必须具有文本/日历的内容类型,并且它应该只有一个部分 - 文本/日历:

    Date: Tue, 27 May 2014 23:17:23 +0300
    Message-ID: <5384f2d3b125b_90c30357c28514@Eric-PC.mail>
    Mime-Version: 1.0
    Content-Type: text/calendar;
     charset=UTF-8;
     method=request;
     name=subject.ics
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable
    content-class: urn:content-classes:calendarmessage
    
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:icalendar-ruby
    CALSCALE:GREGORIAN
    BEGIN:VEVENT
    DTSTAMP:20140527T201722Z
    UID:abb15328-a6af-4c95-8e04-acdb9d6584e2
    DTSTART:20140623T083000
    DTEND:20140624T083000
    CLASS:PRIVATE
    DESCRIPTION:Have a long lunch meeting and decide nothing...
    SUMMARY:Meeting with the man.
    END:VEVENT
    END:VCALENDAR
    

    【讨论】:

    • 在哪里定义 VBCALENDAR ?我已经编辑了问题并添加了代码
    • 它应该是文本/日历 - 请参阅上面的示例消息。
    猜你喜欢
    • 2023-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多