I have a fairly simple email that I need to send using Exchange server. This works locally, but fails when I publish to the server. Here is my code establishing the link to the exchange server:
var service = new ExchangeService(ExchangeVersion.Exchange2010_SP2); service.UseDefaultCredentials = true; service.AutodiscoverUrl(Config.GetGroupMailbox(),RedirectionUrlValidationCallback);
After setting the fields I am simply calling .Send() with no success.
Here is the stack trace:
Microsoft.Exchange.WebServices.Data.ServiceResponseException: SendOnly cannot be used by a user without a mailbox. Use SendAndSaveCopy and specify a folder ID in a mailbox to send an item from an account that doesn't have a mailbox.
at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()
at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalCreateItems(IEnumerable1 items, FolderId parentFolderId, Nullable
1 messageDisposition, Nullable1 sendInvitationsMode, ServiceErrorHandling errorHandling)
at Microsoft.Exchange.WebServices.Data.Item.InternalCreate(FolderId parentFolderId, Nullable
1 messageDisposition, Nullable`1 sendInvitationsMode)
at Microsoft.Exchange.WebServices.Data.EmailMessage.InternalSend(FolderId parentFolderId, MessageDisposition messageDisposition)
at CCSSWorkflow.Models.EmailService.Send(EmailObject EmailObject, EmailSent EmailSentObject)
Thanks for the help/direction,
Sam