有没有人知道将通过MS Exchange Server 2007 Web服务连接的开源PHP类(最好是BSD或MIT许可证).肥皂?
我正在寻找一个更高级别的类,它具有通过发送消息的功能.网络服务.
php exchange-server exchange-server-2007 exchangewebservices
如何知道Exchange WebService URL,我有Exchange服务器版本2007,我正在尝试编写一个小型C#控制台应用程序来从Exchange服务器收集一些数据,但不知道什么是Exchange.WebServices Url.AutodiscoverUrl失败.
我需要一种方法来确定via用户输入配置的交换连接是否有效.我用ews.
我正在尝试获得使用交换Web服务的会议所需的与会者.有任何想法吗?我想我需要使用CalendarItemType,但我不确定如何实现它.到目前为止,这是我的代码:
foreach (var wrk in Workers)
{
TimeWindow timeWindow = new TimeWindow(startDate, endDate);
AvailabilityData requestedData = AvailabilityData.FreeBusy;
List<AttendeeInfo> attendees = new List<AttendeeInfo>();
attendees.Add(new AttendeeInfo(wrk.EmailAddress));
GetUserAvailabilityResults ares = service.GetUserAvailability(attendees, timeWindow, requestedData);
foreach (AttendeeAvailability av in ares.AttendeesAvailability)
{
foreach (CalendarEvent ev in av.CalendarEvents)
{
//get info from each calendarevent
//Possibly use CalendarItemType here?
}
}
}
Run Code Online (Sandbox Code Playgroud)
工人是我用类名单和相应的电子邮件地址列出的类.
至于我现在,我知道如何来从Exchange服务器的约会,但只要我想看到的必需和可选的与会者,这些字段是空的......我查了任命吊起并有与会者,除了我.我是否必须以不同方式配置Outlook或者我是否会错过某些内容?
List<Appointment> listOfAppointments = new List<Appointment>();
CalendarFolder cfolder = CalendarFolder.Bind(MyService, WellKnownFolderName.Calendar);
CalendarView cview = new CalendarView(from.ToUniversalTime(), to.ToUniversalTime());
cview.PropertySet = new PropertySet(ItemSchema.Subject);
cview.PropertySet.Add(AppointmentSchema.Start);
cview.PropertySet.Add(AppointmentSchema.End);
cview.PropertySet.Add(AppointmentSchema.Location);
cview.PropertySet.Add(AppointmentSchema.ICalUid);
cview.PropertySet.Add(AppointmentSchema.Organizer);
cview.PropertySet.Add(AppointmentSchema.IsAllDayEvent);
cview.PropertySet.Add(AppointmentSchema.DateTimeCreated);
FindItemsResults<Appointment> result = cfolder.FindAppointments(cview);
Run Code Online (Sandbox Code Playgroud)
这就是我如何获取约会,正如我从例外和追踪和错误中所知,我不需要交换参与者...但也许我错过了一些东西.
exchange-server exchange-server-2007 exchangewebservices ews-managed-api
调用SyncFolderItems循环(直到MoreChangesAvailable为假)会返回我第一次调用后收到的项SyncFolderItems吗?
例如,假设我的邮箱中有1,000个项目,并且我SyncFolderItems在没有同步状态的情况下拨打电话.在我第一次打电话给SyncFolderItems我收到一个项目后,它会包含我第一次打电话后收到的新电子邮件SyncFolderItems吗?
我目前正在尝试通过 Microsoft 的 EWS 托管 API 从 Outlook 联系人对象中读取某些属性。我从FindItems()函数中检索这些 Contact 对象。其中一些字段是扩展属性,例如TitleorUser1字段,我很难阅读它们。目前,我有:
Guid propertySetId = new Guid("{00062004-0000-0000-C000-000000000046}");
ExtendedPropertyDefinition titleProp = new ExtendedPropertyDefinition(propertySetId, 0x3A45, MapiPropertyType.String);
ExtendedPropertyDefinition user1Prop = new ExtendedPropertyDefinition(propertySetId, 0x804F, MapiPropertyType.String);
string title, user1;
contact.TryGetProperty(titleProp, out title);
contact.TryGetProperty(user1Prop, out user1);
Run Code Online (Sandbox Code Playgroud)
运行这个时,TryGetProperty总是返回false。我已验证这些字段已在 Outlook 中为我正在搜索的联系人填充。
编辑:这就是我检索联系人对象的方式。
ExchangeService service = //...
Mailbox userMailbox = new Mailbox(emailAddress);
FolderId folderId = new FolderId(WellKnownFolderName.Contacts, userMailbox);
FindItemsResults<Item> results;
const string AQS = "Category:~>\"CategoryTag\"";
ItemView view = new ItemView(200);
results = …Run Code Online (Sandbox Code Playgroud) 我正在尝试编写一种方法来查找要与EWS连接的Exchange Server的Exchange Server版本。
很明显,读取对EWS请求的响应XML的内容包含此信息,如此处所述。
我很好奇我是否必须测试并处理错误,或者是否还有另一种“侵入性较小”的方法来查找Exchange版本。
如何找到尝试通过EWS访问的Exchange Server的版本,以便可以针对EWS托管的API活动对其进行设置?
我目前正在使用以下方法,但是我无法想象这是最有效的方法吗?
foreach (ExchangeVersion exchver in Enum.GetValues(typeof(ExchangeVersion)))
{
//Console.WriteLine(exchver.ToString());
try
{
ExchangeService service = new ExchangeService(exchver);
//Do stuff here
}
catch (Exception e)
{
Console.WriteLine("Server is not " + exchver +". Trying next ExchangeVersion.");
}
}
Run Code Online (Sandbox Code Playgroud) 我想从邮件中将附件文件转换为流类型.但是如何创建流?我正确地获取邮件项目(内容,主题,附件).请参阅以下链接: EWS托管API:获取附件我尝试执行以下操作:
int nbAttachments = message.Attachments.Count;
FileAttachment[] attachedFiles = new FileAttachment[nbAttachments];
for (int i=0; i < nbAttachments; i++)
{
attachedFiles[i] = message.Attachments[i] as FileAttachment;
}
for (int i = 0; i < attachments.Length; i++)
{
if (attachments[i].Name != null)
{
AttachmentCreationInformation infoAttachment = new AttachmentCreationInformation();
attachments[i].Load(infoAttachment.ContentStream);
infoAttachment.FileName = attachments[i].Name;
newItem.AttachmentFiles.Add(infoAttachment);
}
}
Run Code Online (Sandbox Code Playgroud)
好吧,不要担心我做了很多测试和管理异常但是把所有代码都放在这里并不重要.
我发现这篇文章:MSDN论坛并尝试以下方法:
FileStream stream = new FileStream(attachments [i] .Name,FileMode.Open);
byte [] byteArray = new byte [stream.Length];
stream.Read(byteArray,0,Convert.ToInt32(stream.Length));
stream.Close();
(这里我的文字被打破了,因为我无法将其转换为代码格式,所以对于斜体来说很抱歉......今天运气不好)
但它搜索本地驱动器上的附件...... …
以下代码适用于单个附件,但与多个文件失败.
<?php
$msgRequest->MessageDisposition = 'SaveOnly';
$msgResponse = $ews->CreateItem($msgRequest);
$msgResponseItems = $msgResponse->ResponseMessages->CreateItemResponseMessage->Items;
// Create attachment(s)
$attachments = array();
$i = 0;
foreach ($message_details['attachment'] as $attachment) {
$attachments[$i] = new EWSType_FileAttachmentType();
$attachments[$i]->Content = file_get_contents($attachment['path'] . '/' . $attachment['file']);
$attachments[$i]->Name = $attachment['file'];
$i++;
}
//
// Attach files to message
$attRequest = new EWSType_CreateAttachmentType();
$attRequest->ParentItemId = $msgResponseItems->Message->ItemId;
$attRequest->Attachments = new EWSType_NonEmptyArrayOfAttachmentsType();
$attRequest->Attachments->FileAttachment = $attachments;
$attResponse = $ews->CreateAttachment($attRequest);
$attResponseId = $attResponse->ResponseMessages->CreateAttachmentResponseMessage->Attachments->FileAttachment->AttachmentId;
// Save message id from create attachment response
$msgItemId …Run Code Online (Sandbox Code Playgroud)