Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.7K
Visualizações
5.7.57 Client not authenticated to send mail

I am a corporate employee. as part of my work I need to send emails from my C# code.

with the below code I am able to send emails successfully using less secure gmail ID. But I am not able to do same with my corporate outlook exchange based email ID. I get below exception.

" 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, SmtpClientAuthentication is disabled for the Mailbox. Visit https://aka.ms/smtp_auth_disabled for more information. [BN9PR03CA0659.namprd03.prod.outlook.com]"

what I should do ? is there a way I can make my corporate outlook exchange email ID less secure to enable to sending emails. (Like I did for gmail.)

below is the code I am using.

MailMessage message = new MailMessage(from, to);

        string mailbody = "In this article you will learn how to send a email using Asp.Net & C#";
        message.Subject = "Sending Email Using Asp.Net & C#";
        message.Body = mailbody;
        message.BodyEncoding = Encoding.UTF8;
        message.IsBodyHtml = true;         
        client.EnableSsl = true;
        client.UseDefaultCredentials = false;
        client.Credentials = new NetworkCredential("name@corporatecompany.com", "$password");            
        client.Host = "smtp.office365.com";
        client.Port = 587;
        client.DeliveryMethod = SmtpDeliveryMethod.Network;          
        try
        {
            client.Send(message);
        }
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You need to make sure the smtp address is correct. It may be different for your org, although using O365 and may be port#. Check with your corporate Email managing team/AD team whoever is responsible for this and try again.

It may be that the smtp host can be your org domain host instead of generic one. I am suggesting based on experience of what we have, as we also use O365 for our corporate emails and I have our smtp host as "mail..com" with port#. And there could be a service account which has given appropriate permissions to use as otherwise, it would become less secure to use the smtp relay.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda