在 Windows 上使用经典 Outlook 管理个人电子邮件、日历和联系人
报错很明确,你也清楚症结所在了。basic authentication is disabled. 需要改用oauth2.0验证身份。
适配改造非一句话能说清楚。建议参考MS Learn官网文档。下面的Outlook经验总结里,也有提供概括说明,以及几个官网文章的网址。仅供参考。
第一 我已经开启微软账号的双重验证 第二 已经启用应用密码 以下是我的配置 spring: mail: default-encoding: UTF-8 # 微软的邮箱是不用设置smtps的,是使用默认的smtp protocol: smtp # smtp-mail.outlook.com host: smtp-mail.outlook.com # 587 port: 587 username: ******@outlook.com # 开启了MFA多重认证的,密码为应用密码,如需使用账号登录密码,则需要关闭多重认证 password: 我的应用密码 # 由于Office365邮件发送启用了STARTTLS的加密验证方式,所以需要通过spring.mail.properties的自定义属性来进行加密信息的相关配置。 properties: mail: smtp: auth: true # 仅设置该项开启STARTTLS starttls: enable: true required: true # imap: # ssl: # # 开启加密 好像是 qq邮箱独有 # enable: true # required: true # 开启邮件发送debug debug: true
最后报错 org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 535 5.7.139 Authentication unsuccessful, basic authentication is disabled. [SI1PR02CA0028.apcprd02.prod.outlook.com 2025-06-04T14:09:27.699Z 08DDA15C68020071]
我有注意到, Outlook.com 需要使用新式身份验证/OAuth2 请问 这两种验证 要怎么实现呢。
在 Windows 上使用经典 Outlook 管理个人电子邮件、日历和联系人
锁定的问题。 此问题已从 Microsoft 支持社区迁移。 你可投票决定它是否有用,但不能添加评论或回复,也不能关注问题。