Hello!
We’re having a problem deleting messages when connected to Office 365 via IMAP (using Aspose version 6.7.0.0)
We call this:
_AsposeImapClient.DeleteMessage(_ImapMessage.UniqueId)
_AsposeImapClient.CommitDeletes()
And we receive this error:
AE0035 NO Command received in Invalid state.
Now we can pull messages, changes flags, and copy them succesfully - but the problem happens when we CommitDeletes. Can you please provide some guidance?
Thank you!
Hi Joseph,
Thank you for writing to Aspose Support team.
We have tested this issue at our end by deleting few messages from Office 365 test account and were not able to face any such problem as you have specified. The message is deleted without any such error raised. Could you please try it with the following test account by sending some test messages first and let us know your feedback?
Username: UserTwo@AsposeJul2016.onmicrosoft.com
Password: Aspose1234
Did you test using IMAP credentials?
I used your account, read the message from the folder called “UFC_Test” and tried to delete it. I received the exact same error.
I’m attaching the properties of the IMAP client for your reference.
Hi Joseph,
Can you please post the code you are using? Thank you!
Hi,
Ok, after working through your sample, I was able to determine that I need to select the folder AGAIN right before we delete the message.
Here’s my updated code for your reference:
For Each _ImapMessage In _ImapMessageInfoCollection
_AsposeImapClient.ChangeMessageFlags(_ImapMessage.UniqueId, Aspose.Email.Imap.ImapMessageFlags.IsRead)
_AsposeImapClient.CopyMessage(_ImapMessage.UniqueId, strMoveToFolderName)
'version 6.7.0.0 of Aspose required that we select the folder
_AsposeImapClient.SelectFolder(objMailbox.MailboxName)
_AsposeImapClient.DeleteMessage(_ImapMessage.UniqueId)
Next
Hi,