Folder Handling

Using the MailClient you can list folders, check their presence, as well as create and delete them:

jmail_folderops.png

Folder Handling

Operations expecting a folderPath argument will treat this the following way:

  • NULL
    This is interpreted as meaning the <Inbox> folder.

  • path beginning with /
    This is interpreted as a path from the mail connections root folder: /Archive/Orders

  • path not beginning with /
    This is interpreted as a relative path to the <Inbox> folder: Archive/Orders translates to /<Inbox>/Archive/Orders.

The intention of this behavior is to abstract away the fact that <Inbox> has many different names depending on the connection, i.e. IMAP typically uses INBOX, Exchange calls it Inbox, and a German Exchange calls it Posteingang.

Also note that POP3 does not support folders other than <Inbox>. Hence when you specify a POP3 connection, folderPath parameters other than NULL will raise an exception.

Operations

listFolders

existsFolderPath

createFolderPath

deleteFolderPath

📗