标签: exchangewebservices

使用 EWS 托管 API 2.0 为现有约会绑定自定义扩展属性

我想使用自定义扩展属性进行唯一的预约以放入数据库。我使用 FindAppointments() 查找所有约会:

var appointments = _service.FindAppointments(WellKnownFolderName.Calendar, calendarView);
Run Code Online (Sandbox Code Playgroud)

然后我使用 foreach 循环完成所有约会:

foreach (var appointment in appointments)
Run Code Online (Sandbox Code Playgroud)

对于所有没有扩展属性的约会:

if (appointment.ExtendedProperties.Count <= 0)
Run Code Online (Sandbox Code Playgroud)

我绑定了一个自定义扩展属性,并使用我专门生成的唯一会议 ID (meetingId) 设置其值:uniqe int 编号:

var myPropertySetId = new Guid("{6C3A094F-C2AB-4D1B-BF3E-80D39BC79BD3}");
var extendedPropertyDefinition = new ExtendedPropertyDefinition(myPropertySetId, "RateTheMeetingId", MapiPropertyType.Integer);
var bindedAppointment = Appointment.Bind(_service, appointment.Id, new PropertySet(extendedPropertyDefinition));
bindedAppointment.SetExtendedProperty(extendedPropertyDefinition, meetingId);
bindedAppointment.Update(ConflictResolutionMode.AlwaysOverwrite);
Run Code Online (Sandbox Code Playgroud)

但它不起作用,因为我搜索会议并尝试输出扩展属性和 tis 值,但我没有得到结果,它没有绑定。我的问题是我做错了什么以及您可以提供哪些其他解决方案来为现有约会提供自定义扩展属性?顺便说一句,我正在使用 MS Exchange server 2010_SP2。

c# exchange-server exchangewebservices ews-managed-api

2
推荐指数
1
解决办法
4586
查看次数

Office 365 Rest API - 检索纯文本电子邮件

目前是否可以使用 Office 365 Rest API 来检索电子邮件的纯文本部分?

从 API 文档中可以看出,'Body' 对象包含可以是TextHTML的 'ContentType' 字段。https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#ItemBody

然而,每当检索到多部分(HTML + 纯文本)消息时,API 只会返回 HTML 部分,如下所示:

{
  "@odata.context": "",
  "@odata.id": "",
  "Id": "",
  "Subject": "Test message",
  "BodyPreview": "This is the body",
  "Body": {
    "ContentType": "HTML",
    "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body style=\"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;\">\r\n<div>This is the body</div>\r\n</body>\r\n</html>\r\n"
  },
  "UniqueBody": {
    "ContentType": "HTML",
    "Content": "<html><body><div>\r\n<div><font face=\"Calibri,sans-serif\" size=\"2\" color=\"black\"><span style=\"font-size:14px;\">\r\n<div>This is the body</div>\r\n</span></font></div>\r\n</div>\r\n</body></html>"
  }, …
Run Code Online (Sandbox Code Playgroud)

email plaintext exchangewebservices office365

2
推荐指数
1
解决办法
3674
查看次数

使用 EWS 托管 API 对邮件文件夹进行编号和过滤

我正在尝试使用Microsoft.Exchange.WebServices 托管 API和基于此 FindFolder() 示例的代码来枚举 Exchange 帐户中的仅电子邮件文件夹。

以下代码过滤所有空文件夹、 、TaskSearch和文件夹ContactsCalendar但仍返回FreeBusy DataRecoverable ItemsDeletions文件夹。

有没有办法可以从返回的文件夹中过滤这些内容,而不是通过名称上的字符串匹配来过滤这些内容?事实上,还有一种过滤方式Sent ItemsDeleted Items?(虽然这些不能被重命名(而且我对它们是什么有更好的了解!),但我不太担心简单地按名称过滤掉它们)

Dim moreFoldersToReturn As Boolean = True
Const FOLDER_PAGE_SIZE As Integer = 10
Dim folderOffset As Integer = 0

While moreFoldersToReturn

    ' Create a view with a page size of x
    Dim view As New FolderView(FOLDER_PAGE_SIZE, folderOffset)

    ' Identify the properties to return …
Run Code Online (Sandbox Code Playgroud)

exchange-server exchangewebservices

2
推荐指数
1
解决办法
991
查看次数

如何使用 EWS 托管 API 访问共享日历

如何使用 Exchange EWS API 仅检索共享日历。

我如何知道使用 Exchange EWS API 共享哪个日历。

exchangewebservices

2
推荐指数
1
解决办法
4552
查看次数

在 iframe 中渲染电子邮件时如何处理 cid 图像源

我们有一个用 Angular4+ 编写的网络电子邮件客户端。我们从 Exchange Web 服务加载电子邮件。

传入的邮件经过清理,然后呈现为 ​​iframe 的源。即使图像也可以正常工作,除非它们是像这样嵌入的

<img width="486" height="572" id="Grafik_x0020_2" src="cid:image002.jpg@01D39103.BD805530">
Run Code Online (Sandbox Code Playgroud)

有没有办法在渲染电子邮件时显示图像?我们也可以下载附件。

谢谢并致以最诚挚的问候克里斯托夫

javascript email iframe embedded-resource exchangewebservices

2
推荐指数
1
解决办法
2189
查看次数

C#fileattachment内容为字符串

我想从电子邮件中的附件中获取内容.我能够阅读电子邮件及其所有属性.附件是一个文本文件(.txt).我如何获取附件的实际文本内容?下面是我的代码的一部分,显示我如何获取每封电子邮件,然后获取其属性并将其存储在findResults列表中.像fileAttachment.Name这样的东西会给我附件的名称.fileAttachment.content.tostring()只显示system.Byte [].

FindItemsResults<Item> findResults = service.FindItems(fid1, new ItemView(int.MaxValue));
service.LoadPropertiesForItems(from Item item in findResults select item, PropertySet.FirstClassProperties);

foreach (Item item in findResults)
{
    String body = "";
    #region attachments
    if (ReadAttachments == "1")
    {
        EmailMessage message = EmailMessage.Bind(service, item.Id, new PropertySet(BasePropertySet.IdOnly, ItemSchema.Attachments));

        foreach (Attachment attachment in message.Attachments)
        {
            if (attachment is FileAttachment)
            {
                FileAttachment fileAttachment = attachment as FileAttachment;

                // Load the file attachment into memory and print out its file name.
                fileAttachment.Load();

                String attachbody = fileAttachment.Content.ToString();

                if (attachbody.Length > 8000) …
Run Code Online (Sandbox Code Playgroud)

c# email exchange-server attachment exchangewebservices

1
推荐指数
1
解决办法
3580
查看次数

Exchange托管API:如何搜索自定义日期以来创建的所有约会?

使用Exchange托管ApI,我需要获得创建日期更新或等于定义日期的所有约会.我怎么做?

.net c# exchange-server exchangewebservices

1
推荐指数
1
解决办法
3150
查看次数

PHP Exchange Web服务 - 获取消息正文

我正在使用PHP EWS库,并以此示例获取消息列表,这些消息完美无缺.

它通过发送者,接收者,主题,时间等细节.我试图浏览所有的库,但我无法锻炼如何通过邮件正文和附件.

有任何想法吗?

php exchange-server exchangewebservices

1
推荐指数
1
解决办法
4440
查看次数

如何拆分字符串并在VB中的循环中使用它们?

我得到一个电子邮件地址的电子邮件地址,由";"分隔 看起来像这样:

geve@krag.de ;;; Tobias@nxs.de; Wissel@weg.de; Sand@nex.de; Claudia@bea.de ;;

我想在这里向这些电子邮件地址发送预约给一个人的样本:

Dim appointment As New EWS.Appointment(esb)
            appointment.Subject = "Einladung zu einem Termin"
            appointment.Body = txtThema.Text
            appointment.Start = Von
            appointment.End = Bis
            appointment.Location = "Raum 202 Kleinostheim"
            appointment.RequiredAttendees.Add("geve@krag.de")  // HERE ARE THE Attendees
            appointment.Save(EWS.SendInvitationsMode.SendToAllAndSaveCopy)
Run Code Online (Sandbox Code Playgroud)

我需要每个电子邮件地址第一个,因为他发送邮件.我怎样才能做到这一点?

在此先感谢您的帮助

vb.net string loops string-split exchangewebservices

1
推荐指数
1
解决办法
4226
查看次数

阅读没有签名的身体

我正在用C#开发一个应用程序,该应用程序使用EWS从交换中读取电子邮件。收到新电子邮件时,我需要将正文保存在数据库中,然后将其重新发送到其他电子邮件@。这已经完成了,但是问题是我应该保存没有签名的新电子邮件。有什么方法可以识别签名从哪里开始?

在此先感谢您的帮助:)

c# exchangewebservices outlook-web-app

1
推荐指数
1
解决办法
618
查看次数