java发送邮箱认证错误553 authentication is required
来源:互联网 发布:龙傲天下战骑进阶数据 编辑:程序博客网 时间:2024/05/29 04:38
因为项目需要,所以拿了之前发布的java邮箱demo来修改,地址如下
http://blog.csdn.net/sun2015_07_24/article/details/50467133,
但是用的时候突然报这个错误
他说我的邮箱没有认证,我很奇怪,以前用的时候不出这错误的。现在却出现的。可能是邮箱服务器那边升级还是怎么了吧。。
那么我们解决这个错误的方法这么做。
错误说要我们认证。那我们就认证一下吧。代码如下
代码总的意思就是校验一下邮箱的用户名和密码是否正确
props.put(“mail.smtp.auth”, “true”);
Authentication authentication = new Authentication(userName, userPwd);
Session session = Session.getDefaultInstance(props,authentication);
class Authentication extends Authenticator{ String username=null; String password=null; public Authentication(){ } public Authentication(String username, String password) { this.username = username; this.password = password; } protected PasswordAuthentication getPasswordAuthentication(){ PasswordAuthentication pa = new PasswordAuthentication(username, password); return pa; } }
加入这些代码后执行。成功发送邮件
0 0
- java发送邮箱认证错误553 authentication is required
- authentication is required (java发送邮件)
- 163邮箱发送邮件碰到:System.Net.Mail.SmtpException: 不允许使用邮箱名称。 服务器响应为:authentication is required
- 不允许使用邮箱名称。 服务器响应为:authentication is required
- javax.mail.MessagingException: 553 authentication is required
- javax.mail.MessagingException: 553 authentication is required
- javax.mail.MessagingException: 553 authentication is required
- smtpClient发邮件错误:不允许使用邮箱名称。 服务器响应为: You are not authorized to send mail, authentication is required
- smtpClient发邮件错误:不允许使用邮箱名称。 服务器响应为: You are not authorized to send mail, authentication is required
- 在Web工程中用JavaMail 发送邮件时报com.sun.mail.smtp.SMTPSendFailedException: 553 authentication is required原因
- Send Error:不允许使用邮箱名称。 服务器响应为: You are not authorized to send mail, authentication is required
- Send Error:不允许使用邮箱名称。 服务器响应为: You are not authorized to send mail, authentication is required
- Send Error:不允许使用邮箱名称。 服务器响应为: You are not authorized to send mail, authentication is required
- redis出现错误:NOAUTH Authentication required.
- com.sun.mail.smtp.SMTPSendFailedException: 553 authentication is required,163 smtp9,DcCowACnMFm7ZwRZ
- java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is required 错误解决方法
- The krb5 extension is required for GSSAPI authentication)
- Full authentication is required to access this resource
- hdoj-4045-Machine scheduling
- 第7课:零基础实战Scala面向对象编程及Spark源码解析
- Android加载动画系列——BlockLoadingAnim
- 火狐(Firefox)浏览器解决首页捆绑的问题
- 数据结构实验之栈:行编辑器(手写模拟栈)
- java发送邮箱认证错误553 authentication is required
- hdu5775Bubble Sort+数状数组求逆序数
- JSP的8个隐含对象
- eclipse python代码块 整体缩进 以及 整体取消缩进
- 用递归实现整数按位顺序输出
- 深入理解抽象类和接口
- 优化冒泡排序
- win7下composer安装不了或composer命令无效的解决办法
- thrift开发踩坑全纪录