阿里企业云邮箱 报错 526 Authentication failure[0]

    xiaoxiao2026-03-14  7

    在阿里万网买了域名 wswhr.com ,申请了免费云邮箱。wswhr@wswhr.com。

    阿里云邮箱已经支持POP3收信和SMTP发信功能,默认已开启。

    如果是用腾讯邮箱(QQ邮箱来测验,需要开启smtp发信功能),开启方式自己百度。

    但是在代码配置,发送邮件的过程中报错如下:

    错误代码如下:

    javax.mail.AuthenticationFailedException: 526 Authentication failure[0] at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:823) at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:756) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:673) at javax.mail.Service.connect(Service.java:317) at javax.mail.Service.connect(Service.java:176) at javax.mail.Service.connect(Service.java:125) at javax.mail.Transport.send0(Transport.java:194) at javax.mail.Transport.send(Transport.java:124) at com.wswhr.LoginServer.util.mail.SimpleMailSender.sendTextMail(SimpleMailSender.java:53) at com.wswhr.LoginServer.util.mail.MailService.sendMail(MailService.java:39) at com.wswhr.LoginServer.util.mail.Test.main(Test.java:7) 最开始配置时,参考文章:

    https://mailhelp.aliyun.com/freemail/detail.vm?knoId=5869705 配置服务器地址:smtp.aliyun.com,结果一直认证失败。认证失败的原因,无非是,

    1、服务器错误

    2、用户名错误

    3、用户名密码不匹配。

    因为刚开始我以为我参考的就是正确的,配置服务器地址没改,就一直出错。

    后来参考了后两篇文章,发现,

    如果用阿里企业邮箱,则,邮箱地址是,smtp.mxhichina.com    /  或者  自己的邮箱地址,比如我的域名是wswhr.com ,则邮箱地址是,smtp.wswhr.com

    邮件发送成功。

    参考文章地址:

    https://help.aliyun.com/knowledge_detail/41443.html

    https://help.aliyun.com/knowledge_detail/36687.html

    相关资源:python入门教程(PDF版)
    最新回复(0)