I need SMTP AUTH enabled for my account ******@hotmail.com to send emails from my desktop application

M Waleed Ashraf 0 Reputation points
2026-05-24T10:53:08.96+00:00

Hi,
I need SMTP AUTH enabled for my account ******@hotmail.com to send emails from my desktop application
i am getting the following error even if i use 2FA and app password

all things are ok but getting the following error

System.Net.Mail.SmtpException HResult=0x80131500 Message=The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 Client not authenticated to send mail. Error: 535 5.7.139 Authentication unsuccessful, basic authentication is disabled. [DX0P273CA0082.AREP273.PROD.OUTLOOK.COM 2026-05-24T09:58:46.966Z 08DEB9496484FCE2] Source=System.Net.Mail StackTrace: at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.EndSend(IAsyncResult result) at System.Net.Mail.SendMailAsyncResult.SendMailFromCompleted(IAsyncResult result) --- End of stack trace from previous location --- at System.Net.Mail.SendMailAsyncResult.End(IAsyncResult result) at System.Net.Mail.SmtpClient.SendMailCallback(IAsyncResult result) --- End of stack trace from previous location --- at TestEmailByWaleed.MainWindow.<SendEmailAsync>d__7.MoveNext() in C:\Users\Terhana\source\repos\TestEmailByWaleed\TestEmailByWaleed\MainWindow.xaml.cs:line 134 This exception was originally thrown at this call stack: [External Code] TestEmailByWaleed.MainWindow.SendEmailAsync(string, string, string) in MainWindow.xaml.cs

Regards
Waleed

Outlook | Web | Outlook.com | Account management, security, and privacy
0 comments No comments

2 answers

Sort by: Most helpful
  1. EmilyS726 257.3K Reputation points Independent Advisor
    2026-05-24T12:53:54.8666667+00:00

    What email app are you using specifically? Outlook.com and hotmail.com nowadays require OAuth2 verification. You can no longer use basic authentication such as app password. Make sure your app supports OAuth2.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-05-24T10:53:25.7533333+00:00

    The error shows that Basic authentication for SMTP is disabled for the account, so SMTP AUTH with username/password from a desktop app will not work for that Outlook.com/Hotmail mailbox.

    For consumer Outlook.com/Hotmail accounts, SMTP AUTH using basic auth has been disabled and cannot be re‑enabled per account. Two-factor authentication and app passwords do not bypass this restriction; the server explicitly returns:

    5.7.139 Authentication unsuccessful, basic authentication is disabled

    To send mail from a desktop application with a Microsoft 365/Outlook.com account, use one of these supported approaches instead:

    1. Use a modern client or library that supports OAuth2 (Modern Authentication) for SMTP/Graph rather than System.Net.Mail with basic auth.
    2. For Microsoft 365 work/school accounts (not Outlook.com), use SMTP AUTH with OAuth as documented in "Authenticate an IMAP, POP or SMTP connection using OAuth" and ensure SMTP AUTH is enabled on the mailbox and in the tenant.
    3. If using a Microsoft 365 work/school mailbox with SMTP AUTH:
      • Verify SMTP AUTH is enabled on the mailbox using Exchange Online PowerShell:
             Get-CASMailbox -Identity <EmailAddress> | Format-List SmtpClientAuthenticationDisabled
        
        If it returns True, enable it:
             Set-CASMailbox -Identity <EmailAddress> -SmtpClientAuthenticationDisabled $false
        
      • Ensure the app uses TLS and the correct endpoint/port:
        • Server: smtp.office365.com
        • Port: 587
        • TLS/StartTLS: Enabled
      • Make sure no Conditional Access or Security Defaults policy is blocking legacy/basic auth if still required, or switch fully to OAuth.

    For Outlook.com/Hotmail specifically, the supported resolution is to move to an OAuth-capable client or API; enabling SMTP AUTH with basic auth for that mailbox is not available.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.