Office 365, Microsoft Exchange Service, Email Exchange using a shared mailbox

Hi Buddika_W,

This forum is discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Based on your description, your case more related Exchange development, I will help move this case to Exchange Server  > Exchange Server Development forum for better support.

Have a nice day!

Kristin

August 20th, 2015 3:53am

Is it possible to use Shared Mailbox and send mail using sendAs option (in C# application)? if there is, please share your advice on this matter. I'm using office 365 services.

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 3:59am

Thank you Kristin Xiew
August 20th, 2015 11:10am

Sure as long as the account running your code has been assigned SendAs Rights to the Shared Mailbox via the Add-RecipientPermission Cmdlet (or the Admin Console) in the EWS Managed API something like this should work

            Mailbox SharedMailbox = new Mailbox("sharedMailbox@domain.onmicrosoft.com");
            EmailMessage SharedEmail = new EmailMessage(service);
            SharedEmail.ToRecipients.Add("blahblahblah@domain.com");
            SharedEmail.Subject = "This is a Test";
            SharedEmail.Body = new MessageBody("Test");
            SharedEmail.From = SharedMailbox.Address;
            SharedEmail.Sender = SharedMailbox.Address;
            SharedEmail.SendAndSaveCopy(new FolderId(WellKnownFolderName.SentItems, SharedMailbox));

Cheers
Glen


Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 12:29am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics