Imap4Folder root = Utils.FindFolder(results, oClient.Imap4Folders) Var results = itpaths.Select(x => string.Join("\\", itpaths.Take(count++))).ToList() I updated the code this way : private static void CreateExchangeStorageFolders(MailClient oClient, string storagePath) If we consider that i want to have such folders organization: Inbox/folderA/FolderB/FolderC/. This code create the first folder on the right place in inbox folder. If (String.Compare(folder.FullPath, folderPath, StringComparison.OrdinalIgnoreCase) = 0) public static Imap4Folder FindFolder(string folderPath, Imap4Folder folders) In that case, there's no particular need to check subfolders.
Eagetmail sub folders full#
I implemented a FindFolder that takes in consideration the full path.
![eagetmail sub folders eagetmail sub folders](https://downloaddevtools-ds1.dlcddt.ir/files/2316/SearchSmall/banner02.png)
Imap4Folder folder = oClient.CreateFolder(įindFolder(results, oClient.Imap4Folders),Ĭonsole.WriteLine("This folder already exists: " + itpath) If (FindFolder(results, oClient.Imap4Folders) = null) Var results = itpath.Select(x => string.Join("/", itpath.Take(count++))).ToList() įor (int i = 0 i < itpath.Length - 1 i++) For this I implemented the CreateExchangeStorageFolders method: private static void CreateExchangeStorageFolders(MailClient oClient, string storagePath) The objective is to create the folders and subfolders as in the storagePath string. MailClient oClient = new MailClient("TryIt") ĬreateExchangeStorageFolders(oClient, storagePath)
![eagetmail sub folders eagetmail sub folders](https://www.emailarchitect.net/eagetmail/sdk/html/vc_eagetmail.jpg)
String storagePath = "inbox/folder1/folder2/folder3" Ĭonsole.WriteLine("Connecting server. OServer.SSLConnection = true oServer.Port = 993 MailServer oServer = new MailServer(serverName, emailAccount, password, ServerProtocol.ExchangeEWS) I have a Main class that retrieve email account information static void Main()