Author |
|
ibee133 Newbie
Joined: 15 August 2006 Location: Thailand
Online Status: Offline Posts: 1
|
Posted: 15 August 2006 at 11:00pm | IP Logged
|
|
|
now when I check for exist folder in imap I 've use this command
ListFolder = IMP.DownloadFolders();
foreach (Folder EmailFolder in ListFolder)
{
//Folder Created But Not Subcribe
if (FolderSysName.Trim() == EmailFolder.ShortName)
......
do you have any command that can check exist folder shorter than this?
thanks
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 16 August 2006 at 7:26am | IP Logged
|
|
|
In order to check the folder for existence you can use Imap.GetFolderStatus method which gets the status of the specified folder without selecting it. For example, as follows (in C# syntax):
Code:
Imap imp = new Imap();
// Connect to the server and log into account
imp.Connect("mail.domain.com");
imp.Login("jdoe", "secret");
string folder_name = "Inbox";
// Try to download folder status information
try
{
FolderStatus status = imp.GetFolderStatus(folder_name);
Console.WriteLine("The " + folder_name + " folder exists on the server");
}
catch (MailBeeImapNegativeResponseException ex)
{
Console.WriteLine("The " + folder_name + " folder does not exist on the server");
}
imp.Disconnect();
|
|
|
Best regards,
Alex
|
Back to Top |
|
|