web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / IMAP connect using mai...
Power Automate
Unanswered

IMAP connect using mail fetch in Power Automate

(0) ShareShare
ReportReport
Posted on by

I am trying to connect to an Office 365 mail account and fetch emails using Power Automate Desktop. I receive the error below even though the credentials I supply are correct

 

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Authentication failed on IMAP server outlook.office365.com. ---> MailKit.Security.AuthenticationException: LOGIN failed.
at MailKit.Net.Imap.ImapClient.<AuthenticateAsync>d__83.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MailKit.Net.Imap.ImapClient.Authenticate(Encoding encoding, ICredentials credentials, CancellationToken cancellationToken)
at MailKit.MailService.Authenticate(Encoding encoding, String userName, String password, CancellationToken cancellationToken)
at Microsoft.Flow.RPA.Desktop.Modules.Email.Actions.EmailActions.RetrieveEmails(Variant imapServer, Variant username, Variant varPassword, Variant mailFolder, Variant fromContains, Variant toContains, Variant subjectContains, Variant bodyContains, Variant sentSince, Variant sentUpTo, Variant saveAttachmentsInto, Variant& retrievedEmails, Int32 serverPort, Boolean enableSsl, Int32 retrieveOnlyUnread, Boolean saveAttachments, Boolean markAsRead, Boolean acceptUntrustedCertificates)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.Email.Actions.RetrieveEmails.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

Categories:
I have the same question (0)
  • JGT Profile Picture
    32 on at

    I don't believe office 365 supports IMAP by default it uses Exchange protocol(kinda) I've run into this before not with Power Automate but with legacy email migrations. Check this out -https://learn.microsoft.com/en-us/exchange/troubleshoot/administration/cannot-connect-mailbox-pop-imap-outlook. I wouldn't recommend using basic authentication for o365 and figuring out if exchange protocol is supported in Power Automate Desktop(or doing it all in a cloud flow thats what I've done when connecting to o365 emails). If you can use PAD to send back the information you need to a cloud flow then do all the email work on the cloud side(which may not work in your usecase). I can try to test this too but I've run into issues with this before but that is because we use a third party 2fa application that blocks those types of authentication.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard