Office 365 的 SMTP 无法识别的认证类型

请先使用 openssl 工具测试您的配置

  1. 编码您的 Office365 用户
echo -n "your email here " | openssl enc -base64
xxx_encoded_email_xxx
  1. 编码您的密码
echo -n "your password here" | openssl enc -base64
xxx_encoded_password_xxx
  1. 打开连接
openssl s_client -connect SMTP.office365.com:587 -starttls smtp -quiet -crlf
  1. 测试身份验证
  • 等待消息 250 SMTPUTF8
  • 发送 EHLO SMTP.office365.com
  • 等待响应
    250-PR3P189CA0029.outlook.office365.com Hello [88.138.0.68]
    250-SIZE 157286400
    250-PIPELINING
    250-DSN
    250-ENHANCEDSTATUSCODES
    250-AUTH LOGIN XOAUTH2
    250-8BITMIME
    250-BINARYMIME
    250-CHUNKING
    250 SMTPUTF8
    
  • 发送 AUTH LOGIN
  • 等待 334 VXNlcm5hbWU6
  • 发送您编码后的用户登录名 xxx_encoded_email_xxx
  • 等待 334 UGFzc3dvcmQ6
  • 发送您编码后的密码 xxx_encoded_password_xxx
  • 等待响应 235 2.7.0 Authentication successful