Hi
- read emails
- create folders in the shared mailbox
- move emails from the inbox to the newly created folder
- mark emails as read in the shared mailbox
Hi
Hi Eric,
Thank you for writing to Aspose Support team.
In order to achieve this, you can use the Exchange Impersonation feature of the API. Please try it at your end and let us know if you need further assistance in this regard.
Sample Code:
// Create instance’s of EWSClient class by giving credentials
IEWSClient client1 = EWSClient.GetEWSClient(“[https://outlook.office365.com/ews/exchange.asmx ](https://outlook.office365.com/ews/exchange.asmx)”, “testUser1”, “pwd”, “domain”);
IEWSClient client2 = EWSClient.GetEWSClient(“[https://outlook.office365.com/ews/exchange.asmx ](https://outlook.office365.com/ews/exchange.asmx)”, “testUser2”, “pwd”, “domain”);
{
string folder = “Drafts”;
try
{
foreach (ExchangeMessageInfo messageInfo in client1.ListMessages(folder))
client1.DeleteMessage(messageInfo.UniqueUri);
string subj1 = string.Format(“NETWORKNET_33354 {0} {1}”, “User”, “User1”);
client1.AppendMessage(folder, new MailMessage(“User1@exchange.conholdate.local”, "To@Aspose.com", subj1, “”));
foreach (ExchangeMessageInfo messageInfo in client2.ListMessages(folder))
client2.DeleteMessage(messageInfo.UniqueUri);
string subj2 = string.Format(“NETWORKNET_33354 {0} {1}”, “User”, “User2”);
client2.AppendMessage(folder, new MailMessage(“User2@exchange.conholdate.local”, "To@aspose.com", subj2, “”));
ExchangeMessageInfoCollection messInfoColl = client1.ListMessages(folder);
client1.ImpersonateUser(ItemChoice.PrimarySmtpAddress, “User2@exchange.conholdate.local”);
ExchangeMessageInfoCollection messInfoColl1 = client1.ListMessages(folder);
client1.ResetImpersonation();
ExchangeMessageInfoCollection messInfoColl2 = client1.ListMessages(folder);
}
finally
{
try
{
foreach (ExchangeMessageInfo messageInfo in client1.ListMessages(folder))
client1.DeleteMessage(messageInfo.UniqueUri);
foreach (ExchangeMessageInfo messageInfo in client2.ListMessages(folder))
client2.DeleteMessage(messageInfo.UniqueUri);
}
catch { }
}
}
Hi
Hi Eric,
We created a shared mailbox by following instructions on this link: [https://support.office.com/en-us/article/Create-shared-mailboxes-in-Office-365-for-Small-Business-ECACF5B0-B5C8-449F-A89A-B7E87DCB55D4?ui=en-US&rs=en-US&ad=US&fromAR=1 ](https://support.office.com/en-us/article/Create-shared-mailboxes-in-Office-365-for-Small-Business-ECACF5B0-B5C8-449F-A89A-B7E87DCB55D4?ui=en-US&rs=en-US&ad=US&fromAR=1) .
A shared mailbox asks for a definite email address and you can not leave this field empty. Once you provide the email address, you can assign it a password by going to the [users tab ](http://prntscr.com/cylbxo)
. After this, you can access the shared mailbox with this email and password. Once such mailbox we have created is here:
**Username:** [AsposeShared@AsposeOct2016.onmicrosoft.com](mailto:AsposeShared@AsposeOct2016.onmicrosoft.com)
Password: Aspose1234
Please try it at your end and let us know your feedback.
So using Aspose library, there is no way of accessing a real virtual (without password) shared mailbox without a password?
Hi Eric,
As this kind of mailbox will become more popular, are you planning to support it in the “near” future?
Hi,
Hi,
Unless I missed something from your link, nothing in there is for a real “Office 365 Shared Mailbox”. That kind of mailbox does not have a password assign to it. The mailbox exist (without a password) and it is shared to another fully-registered user.
Hi,