Fix C# IMAP App Password Authentication Failures
Question details
The user is unable to authenticate an IMAP connection using an app password within a C# application.
- Product
- Exchange Online
- Device & OS
- not provided
- Scenario
- Attempting to programmatically access an IMAP mailbox using C# code and an app password for authentication.
- Observed behavior
- The IMAP authentication fails, preventing the C# application from successfully logging into the Exchange server.
Confirm that IMAP is enabled for the specific mailbox in the Microsoft 365 Admin Center and verify that Microsoft's deprecation of Basic Authentication has not affected your tenant's ability to use app passwords.
Seek Targeted Microsoft Developer Support
Since this is a specialized code and Exchange connectivity issue, posting in dedicated Microsoft developer forums is the most effective way to resolve it.
General Exchange Online support has limited tools for troubleshooting programmatic authentication errors. Microsoft's dedicated developer support engineers have the specific resources needed to investigate C# IMAP failures.
Compile your IMAP provider details, the authentication method being used in your code, the exact error message returned, and confirmation that your app password is valid.
Extract the relevant portion of your C# authentication code. Ensure you strictly remove any actual passwords, app passwords, email addresses, or sensitive tokens before sharing.
Navigate to the 'C# - Microsoft Q&A' or 'Office Development - Microsoft Q&A' forums and submit your detailed question to receive specialized assistance.

Verify App Password and Account Configurations
Ensure your app password is newly generated and that your Exchange account is configured to allow legacy authentication if required.
Looking for a reliable Office suite? Try WPS Office
While you troubleshoot your C# Exchange code, consider using WPS Office for your daily productivity needs. It is a highly compatible, free alternative to Microsoft Office that easily handles all your documentation without heavy resource requirements.
- 1. Download the installer: Visit the official WPS Office website and click the free download button.
- 2. Install the software: Run the downloaded executable file and follow the on-screen prompts to install the suite.
- 3. Open and create documents: Launch WPS Office to instantly open Microsoft Office formats or start creating new documents.

Frequently Asked Questions
Why is my IMAP app password suddenly failing in C#?
Microsoft has aggressively deprecated Basic Authentication for Exchange Online. Even with an app password, if your tenant has Modern Authentication strictly enforced and Basic Auth disabled, traditional IMAP logins will fail. You may need to transition your code to use OAuth 2.0.
What information should I include when asking for C# support?
When posting to Microsoft Q&A, include your IMAP provider, the specific authentication protocol in use, a sanitized version of your C# code, the exact exception or error message, and the .NET framework version you are running.
Can I use an app password if Multi-Factor Authentication (MFA) is disabled?
App passwords are specifically designed to bypass interactive MFA prompts for legacy applications. If MFA is not enabled on the account, standard passwords are typically used, and the option to generate an app password might not be available in your security settings.




