[英]The SMTP server requires a secure connection or the client was not authenticated.(535 5.7.3)?
I am totally fed-up with Office 365 SMTP configuration, I have done all requirements to send email using my account on Office 365, and always giving me the same error message:我完全厌倦了 Office 365 SMTP 配置,我已经完成了使用我在 Office 365 上的帐户发送 email 的所有要求,并且总是给我相同的错误消息:
The SMTP server requires a secure connection or the client was not authenticated. SMTP 服务器需要安全连接或客户端未通过身份验证。 The server response was: 5.7.57 Client not authenticated to send mail.服务器响应为:5.7.57 客户端未通过身份验证以发送邮件。 Error: 535 5.7.3 Authentication unsuccessful [DX0P273CA0007.AREP273.PROD.OUTLOOK.COM 2023-06-01T20:34:23.527Z 08DB62D998FCDD7E]错误:535 5.7.3 身份验证不成功 [DX0P273CA0007.AREP273.PROD.OUTLOOK.COM 2023-06-01T20:34:23.527Z 08DB62D998FCDD7E]
the below code is used for sending the email which I don't think it has any issue下面的代码用于发送 email,我认为它没有任何问题
SmtpClient smtpClient = new SmtpClient("smtp.office365.com", 587);
smtpClient.EnableSsl = true;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = new NetworkCredential("hajjaj@alhajjaji.com", "*******");
// Set up the email message
MailMessage mailMessage = new MailMessage();
mailMessage.From = new MailAddress("hajjaj@alhajjaji.com");
mailMessage.To.Add("hajjaj@gmail.com");
mailMessage.Subject = EmailSubject;
mailMessage.Body = EmailMsg;
mailMessage.IsBodyHtml = true;
smtpClient.Send(mailMessage);
Application password is added as you can see如您所见,已添加应用程序密码
SMTP is enabled for that Mailbox also还为该邮箱启用了 SMTP
SMTP Disabled status: not disabled SMTP 禁用状态:未禁用 any help will be very apricated.任何帮助都会非常有用。 thanks谢谢
For smtp.office365.com to work, you need to do the following:要使smtp.office365.com正常工作,您需要执行以下操作:
BTW, make sure you are using .NET Framework 4.8 or later and user's office 365 MFA option is disabled.顺便说一句,请确保您使用的是 .NET Framework 4.8 或更高版本,并且禁用了用户的 office 365 MFA 选项。
Sounds like the SMTP authentication of your Office 365 account hasn't been enabled.听起来您的 Office 365 帐户的 SMTP 身份验证尚未启用。 The third-party application uses SMTP submission to authenticate Office 365 account.第三方应用使用SMTP提交验证Office 365账号。 To enable the SMTP auth, you can refer to the Enable or disable authenticated client SMTP submission (SMTP AUTH) in Exchange Online article.要启用 SMTP 身份验证,您可以参考在 Exchange Online 中启用或禁用经过身份验证的客户端 SMTP 提交 (SMTP AUTH) 一文。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.