4D Blog

Home Product IMAP API: Retrieve Unread Email Counts for multiple mailboxes in One Call

IMAP API: Retrieve Unread Email Counts for multiple mailboxes in One Call

November 7, 2024

Product

Many of you rely on IMAP commands to display the number of unread emails in your app’s UI, helping users stay informed about new messages. With 4D 20 R7, we’ve enhanced the IMAPTransporter.getBoxList() function, enabling it to retrieve unread email counts and mailbox properties simultaneously, ensuring faster response times.

IMAP Transporter

To optimize the response time, IMAPTransporter.getBoxList() now has new options that let you get email counts for multiple mailboxes in one call. If you want to display all mailbox names with their number of unread emails, total emails, and recent emails, you can do this in one go using the “withBoxInfo” parameter:

var $boxes:=$transporter.getBoxList({withBoxInfo: True})

If you want to check the number of unseen emails for specific mailboxes, you can pass a collection with the names of the mailboxes:

$boxes:=$transporter.getBoxList({withBoxProperties: False; withBoxInfo: True; names: ["INBOX"; "Drafts"]})

blank

These improvements simplify keeping your users updated on their unread emails by delivering all the essential information in just one call. Since everything is handled in a single request, the response times are much faster compared to previous methods. This same improvement has also been applied to Gmail API of 4D Netkit, allowing you to retrieve unread email counts and mailbox properties in a single call for optimal performance.

If you need further information, please consult the IMAPTransporter documentation.

Discuss

Tags 20 R7, 21, 4D NetKit, IMAP

Latest related posts

  • February 3, 2026

    4D Write Pro – Adding a margin automatically when bullets are set using standard actions

  • January 22, 2026

    Transform Static Documents into Actionable Knowledge with AIKit

  • January 22, 2026

    Deploy Fluent UI effortlessly in your 4D applications

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • Email, Microsoft 365, Gmail
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • 4D Qodly Pro
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 21 R2 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D-Analyzer 4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 21 21 R2 Administration AI Artificial Intelligence Build application Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy