Check outbox is empty or not?

Hello All,

Can you please help me to find how we can check, that outbox is empty or not. As some email are stucking in outbox(Bot is closing outlook before sending all emails.) so need to know how we check and if any emails are there in outbox then how to use retry scope until all email are sent.
Please help.

Let me know if you need more information.


For checking Outbox use Get Outlook mail and Write “Outbox” To read mails in mail folder

Thanks for quick reply.

I have tried to use that but when am using it some emails are stuck in outbox and also unable to send manually.
Do you have other alternative to resolve this?

Which activity you are using for sending mails?
Is your Outlook is opend?
or try Send Exchange Mail Message

I am using Send Outlook activity and outlook is also open.
I have tried to use Send Exchange Mail activity and it is working fine but it takes more time to send all the emails so i am trying to use some alternative which can save the time as well as the give efficient solution.
To check outbox again and again : first i have sent all the emails then used Retry Loop where i have used get outlook mail from outbox then checking if emails are there then go for retry if not then close the outlook.

Is there anything which i have put incorrect please let me know.

This might occurs due to Outlook or internet problem
U can loop it by using Outbox mails count if greater than 0 then it will wait for a while using delay and again check for Outbox mail messages count. Use flow decision for looping or while loop.

Yeah, I have tried this one also :slightly_smiling_face: .

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., and FolderName in this case would be “Outbox”. (1.9 KB)