EWS api抛出异常"内部服务器错误"

时间:2015-08-31 09:49:22

标签: c# exchangewebservices ews-managed-api

我使用以下代码发送回复,但我收到异常发生内部服务器错误。 SendAndSaveCopy()上的操作失败

EmailMessage email = EmailMessage.Bind(service, item.Id);
email.Load();
ResponseMessage reply = email.CreateReply(email.ReplyTo.Count > 1 ? true : false);
string data = email.Subject.Split(':')[1].Trim();
reply.BodyPrefix = CreateHtmlBodyForReplyMail(email.From.Address, Convert.ToInt32(email.Subject.Split(':')[1].Trim()), message, status);
reply.SendAndSaveCopy(); // Exception is in this line

堆栈跟踪:

Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ProcessWebException(WebException webException) in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\Requests\ServiceRequestBase.cs:line 995
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request) in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\Requests\ServiceRequestBase.cs:line 831
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request) in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\Requests\ServiceRequestBase.cs:line 724
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute() in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\Requests\SimpleServiceRequestBase.cs:line 40
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest1.Execute() in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\Requests\MultiResponseServiceRequest.cs:line 157
at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalCreateResponseObject(ServiceObject responseObject, FolderId parentFolderId, Nullable 1 messageDisposition) in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\ExchangeService.cs:line 71
at Microsoft.Exchange.WebServices.Data.ResponseObject 1.InternalCreate(FolderId destinationFolderId, MessageDisposition messageDisposition) in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\ServiceObjects\ResponseObjects\ResponseObject.cs:line 86
at Microsoft.Exchange.WebServices.Data.ResponseObject 1.SendAndSaveCopy() in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\ServiceObjects\ResponseObjects\ResponseObject.cs:line 156
at MailingService.Common.MailBLL.SendReply(Item item, String message, String status) in c:\Users\fahad.r\Desktop\MailingService\MailingService.Common\BLL\MailBLL.cs:line 124
at MailingService.Common.MailBLL.SyncMail() in c:\Users\fahad.r\Desktop\MailingService\MailingService.Common\BLL\MailBLL.cs:line 87`

如果我使用其他帐户发送和接收邮件但具有相同的域名,则可以正常使用。

我需要改变什么?

0 个答案:

没有答案