Renaming a folder disappears it

We using Imap client to rename a folder on server. However, when we rename the folder, it disappears from the server.

Hi Leo,

Thank you for writing to Aspoose Support team.

We have tested this issue at our end with the latest version of the API and were not able to reproduce the problem. Following sample code has been used to test this issue. Please try it at your end and let us know your feedback.

Sample Code:

ImapClient client = new ImapClient(“[exchange.domain.com](http://exchange.domain.com/)”, “username”, “password”);

Console.WriteLine(client.AutoCommit);

client.AutoCommit = false;

ImapFolderInfoCollection folders = client.ListFolders(ImapFolderInfo.InBox);

foreach (ImapFolderInfo fi in folders)

{

Console.WriteLine(fi.Name);

if (fi.Name.Equals(“INBOX/S1”))

{

client.RenameFolder(“INBOX/S1”, “INBOX/S2”);

}

}

Kashif,


I was missing the suffix of folder in the RenameFolder statement. I have fixed it now and it works fine. Thanks for all your help…

Hi Leo,


You are welcome and please feel free to write to us if you have any further query in this regard.