Dear Team,
Hi,
Thank you for writing to us again.
Please give a try to the following sample code which moves emails with specific subject to some other folder from the Inbox.
IEWSClient client = GetAsposeEWSClient();
//Create ExchangeMailboxInfo instance to save default mailbox info
ExchangeMailboxInfo mailbox = client.GetMailboxInfo();
//Declare variable for getting specified custom folder uri
ExchangeFolderInfo DestfolderInfo = new ExchangeFolderInfo();
//Check if specified custom folder exisits
client.FolderExists(mailbox.InboxUri, "DestinationFolder", out DestfolderInfo);
ExchangeQueryBuilder builder = new ExchangeQueryBuilder();
MailQuery qry = builder.Subject.Equals("Subject to be searched", true);
ExchangeMessageInfoCollection coll = client.ListMessages("Inbox", qry);
if (DestfolderInfo != null)
{
foreach (ExchangeMessageInfo info in coll)
{
client.MoveItem(info.UniqueUri, DestfolderInfo.Uri);
}
}
Hi,
Hi,
Assuming there is a folder with name “T1” at the same level as inbox, the following code sample works fine at our end.
Sample Code:
IEWSClient client = GetOffice365Account("UserOne@Aspose2016Mar.onmicrosoft.com"); //some test office 365 account
ExchangeMessageInfoCollection msgsColl = client.ListMessages(client.MailboxInfo.InboxUri);
ExchangeFolderInfoCollection subfolders = client.ListSubFolders(client.MailboxInfo.RootUri);
foreach (ExchangeFolderInfo fi in subfolders)
{
if (fi.DisplayName.Equals(“T1”))
client.MoveItem(msgsColl[0].UniqueUri, fi.Uri);
}
For your other issue of emials fetched at a time limited to 1000, the issue is already known to us and logged as EMAILNET-35159 in our issue tracking system. We’ll update you here once there is some information available in this regard.
Dear Team,
Hi,
Our Product team has investigated this issue and have found it to be configuration settings with Office 365 server that returns result by pages, ignoring client settings. In order to work correctly, please use the paging support with 1000 items per page as detailed in this example.