Check outbox is empty or not?

I had the same issue of email not sending before Bot closed Outlook.
This Powershell script to get the folder item count seems to work. Account is the email account (e.g., MyEmail@mydomain.com) and FolderName in this case would be “Outbox”.
GetOutlookFolderItemCount.zip (1.9 KB)