1
Vote

How to check whether a folder/label exists

description

Hi,
I have created some labels for sorting the emails/messages received based on some criteria. I can move the message to the right folders. My issue is how to check if a folder already exists or not, if not I want to create that folder.

so for example,
var isValidLabel = client.Folders["name"].
        if (!isValidLabel)
            client.Folders.Add("name");
but none of the properties of Folder have that option. Any help is appreciated

comments