Get mail messages on unattended Robot

The get outlook messages should retrieve the updated mailbox even in unattended mode.
I get the updated mailbox even if Outlook is closed. Can you share the code sample?
You can also try reading emails with Get POP3 activity.