如何通过ews将icalendar项目作为消息内容发送?

时间:2016-04-15 05:05:13

标签: exchangewebservices icalendar

我想通过ews将icalendar项目保存为消息内容,这是我的soap envolope看起来像

<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Header>
  <RequestServerVersion xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Version="Exchange2007_SP1"/>
</Header>
<Body>
  <CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" MessageDisposition="SaveOnly">
    <SavedItemFolderId>
      <DistinguishedFolderId xmlns="http://schemas.microsoft.com/exchange/services/2006/types" Id="outbox"/>
    </SavedItemFolderId>
    <Items>
      <Message xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
        <MimeContent CharacterSet="UTF-8">EXCHANGE_MIME_CONTENT</MimeContent>
        <ItemClass>Message</ItemClass>
      </Message>
    </Items>
  </CreateItem>
</Body>
</Envelope>

这是我的iCalendar项目看起来像

MIME-version: 1.0
From: testEmailAddress
Message-ID: testId
To: testRecipientEmail
Date: Fri, 15 Apr 2016 03:52:01 GMT
Subject: =?UTF-8?B?5LqL5Lu26YKA6K+377yaIOaWsOW7uuS8muiurg==?=
Content-type: multipart/alternative 
boundary="Boundary_(ID_qyG4ZdjoAsiZ+Jo19dCbWQ)"
--Boundary_(ID_qyG4ZdjoAsiZ+Jo19dCbWQ)
Content-type: text/calendar; method=REQUEST; charset=UTF-8
Content-transfer-encoding: 8bit

BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VTIMEZONE
TZID:Asia/Shanghai
BEGIN:STANDARD
TZOFFSETFROM:+0800
TZOFFSETTO:+0800
TZNAME:CST
DTSTART:19700101T000000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20160415T035017Z
LAST-MODIFIED:20160415T035201Z
DTSTAMP:20160415T035201Z
UID:9b4556c3-c85e-42b6-af0d-73c0486474ab
SUMMARY:New Meeting
ORGANIZER;testOrganizer
ATTENDEE;testAttendee
DTSTART;TZID=Asia/Shanghai:20160415T120000
DTEND;TZID=Asia/Shanghai:20160415T130000
END:VEVENT
END:VCALENDAR

--Boundary_(ID_qyG4ZdjoAsiZ+Jo19dCbWQ)--

然后我在之前创建的信封中使用base64 EXCHANGE_MIME_CONTENT编码iCalender项目。但是在保存该邮件后,我只收到发件箱中的空电子邮件,其中没有显示iCalendar内容。 有人请告诉我如何通过ews将这个iCalendar项目添加到电子邮件中? 任何建议将不胜感激。

PS,我的交换服务器是2007 SP1。

0 个答案:

没有答案