解决org.springframework.mail.MailAuthenticationException
来源:互联网 发布:nginx 防止ddos 编辑:程序博客网 时间:2024/05/22 14:23
参照网上的例子做spring+mail进行发邮件时,会抛出org.springframework.mail.MailAuthenticationException!
现在大部分邮箱默认是不开启smtp的,所以做spring+mail的发邮件程序,先开启邮箱的smtp。
163的开启smtp 方式参考:
http://jingyan.baidu.com/article/9faa72318b76bf473c28cbf7.html
一定要记住客户端授权密码!!!!!
一定要记住客户端授权密码!!!!!
一定要记住客户端授权密码!!!!!
重要的事说三遍!
接着,参照http://gundumw100.iteye.com/blog/476461 进行配置,但是我们依然会报org.springframework.mail.MailAuthenticationException!
最后找到是参照其配置时下面的这段没弄明白:
<bean id="smtpAuthenticator"
class="yourpackge.service.SmtpAuthenticator">
<constructor-arg value="yourname" ></constructor-arg>
<constructor-arg value="yourpassword" ></constructor-arg>
</bean>
其中的password应该是邮箱的客户端授权密码!
0 0
- 解决org.springframework.mail.MailAuthenticationException
- org.springframework.mail.MailAuthenticationException: Authentication failed
- spring发送邮件时遇到错误org.springframework.mail.MailAuthenticationException: Authentication failed;
- org.springframework.mail.MailPreparationException: mail.user isn't set
- org.springframework.remoting.RemoteLookupFailureException解决
- org.springframework.dao.CannotAcquireLockException解决
- 解决: org.springframework.core.MethodClassKey
- java.lang.ClassNotFoundException: org.springframework.mail.javamail.JavaMailSenderImpl
- org.springframework.orm.hibernate.HibernateObjectRetrievalFailureException 解决
- 解决: org.springframework.beans.factory.BeanNotOfRequiredTypeException办法
- org.springframework.jdbc.UncategorizedSQLException 错误解决
- 解决: org.springframework.beans.factory.BeanNotOfRequiredTypeException办法
- 解决: org.springframework.beans.factory.BeanNotOfRequiredTypeException办法
- org.springframework.core.BridgeMethodResolver异常的解决
- spring:org.springframework.transaction.UnexpectedRollbackException解决
- 解决: org.springframework.beans.factory.BeanNotOfRequiredTypeException办法
- org.springframework.dao.InvalidDataAccessApiUsageException 原因和解决
- 解决: org.springframework.beans.factory.BeanNotOfRequiredTypeException
- 前端日记
- 在Eclipse中创建Maven多模块工程的例子
- 欢迎使用CSDN-markdown编辑器
- Error: Error parsing D:\adt-bundle-windows-x86_64\sdk\system-images\android-23\android-wear\armeabi-
- 找出两个字符串的最长相同字符串及指定字符串频率
- 解决org.springframework.mail.MailAuthenticationException
- 软件测试分类-按照开发阶段划分
- μCOS-II系统之时间管理函数OSTimeDly()
- c语言学习笔记之全局变量与局部变量
- poj2976
- libvirt获取虚拟机的状态
- Qt标准对话框之QMessageBox
- μCOS-II系统之时间管理函数OSTimeDlyResume()
- UVALive 6849Landmine Cleaner(贪心、扫雷经典游戏)