The Mail feature, a huge feature set. The first part was released with 4D v17 R4, and since then we have delivered more and more functionalities.
4D v19 is no exception, as it brings new functions to help you manage your mailboxes by programming. That includes creating, renaming, and deleting mailboxes. A mailbox is displayed as a folder in email clients such as Microsoft Outlook or Apple Mail.
Create a mailbox
To create a new mailbox, use the createBox() function. For example, if you want to create a new “Invoices” mailbox at the root:
And if you want to add some children mailboxes to your mailbox, enter the full path with the IMAP server’s separator character:
// create mailboxes name with separator() function
$name2:="Invoices"+$transporter.getDelimiter()+"Nova Orion Industries"
// Adds new mailboxes related to "Invoices"
Here is what you obtain in your mail browser:
rename a mailbox
If you want to rename your “Invoices” mailbox in “Bills”, use the renameBox() method:
Here is what you obtain in the mail browser:
delete a mailbox
If a mailbox is no longer used, you can delete it with the deleteBox() function:
$name3:="Bills"+$transporter.getDelimiter()+"Nova Orion Industries"
Here is what you otbain in your mail browser:
Subscribe to a mailbox
Check out the documentation and the HDI above to learn more about the new functions!