【错误解决】SpringBoot邮件服务的一些错误及其解决方案

本文分析了 Spring Mail 发送过程中出现的几种常见错误,并提供了详细的解决方案,包括配置正确的邮箱地址、开启 SMTP 服务及使用正确的密码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >



【1】
Servlet.service() for servlet [dispatcherServlet] in context with path [/helloworld] threw exception [Request processing failed; nested exception is org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 501 mail from address must be same as authorization user
;

【错误分析】
设置的发送邮箱不正确,也就是发送邮箱必须和配置时的邮箱名相同,没设置也不行,否则会出此错误,

【解决方案】
配置文件中有,例如:

spring
  mail:
    host: smtp.exmail.qq.com
    username: ****@zslstudy.cn
    password: *******
    default-encoding: UTF-8



【2】
Servlet.service() for servlet [dispatcherServlet] in context with path [/helloworld] threw exception [Request processing failed; nested exception is org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 535 Error: authentication failed, system busy
] with root cause

【错误分析】
验证失败,,系统繁忙。。。。原因是密码输入错了。

【解决方案】
第三方使用邮件发送时,需要开通,【smtp/pop3】服务,,开启的时候会给个密码,,就是上面的password【例如这种:xnrdtvcsdemdicag】



【腾讯企业邮箱设置如下】(个人邮箱,哎,,不太好搞)
这里写图片描述
这里写图片描述


【3】
535 Error: ÇëʹÓÃÊÚȨÂëµÇ¼¡£ÏêÇéÇë¿´: http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256

【错误分析】
乱码了,,然后给了个网址,点进去一看什么什么授权码,此处博主已经申请并使用授权码了,,居然还有错?

哎,想起别人曾说,qq邮箱有很多限制,现在感觉到了,还是使用网易邮箱或者是腾讯企业邮箱(有域名就可以注册,免费的50个)

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

鼠晓

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值