zoukankan      html  css  js  c++  java
  • com.sun.mail.smtp.SMTPSendFailedException: 530 Authentication required 解决方案

    530 Authentication required
    com.sun.mail.smtp.SMTPSendFailedException: 530 Authentication required

     at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
     at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
     at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
     at com.email.SendTextMail.send(SendTextMail.java:112)
     at org.apache.jsp.sendMail_jsp._jspService(sendMail_jsp.java:71)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
     at java.lang.Thread.run(Unknown Source)

    使用JSP发送新浪邮件的时候老是报下面这个异常,后来查资料只要如下改就可以了:

    1 Properties props = System.getProperties();
    2         //指定SMTP服务器
    3         props.put("mail.smtp.host", SMTPHost);
    4         props.put("mail.smtp.auth", "true"); //true一定要加引号

    把true加上引号就可以了。

  • 相关阅读:
    Google Protocol Buffer 的使用和原理(转)
    在python开发工具PyCharm中搭建QtPy环境(详细)
    Docker容器的操作
    Docker镜像操作
    最新版本Docker的安装和使用
    linux CentOS如何安装KVM
    在Linux CentOS下如何安装tar.gz和RPM软件包
    Linux忘记root密码后如何在grub界面中以单用户模式进入系统并重置密码的方法
    Django中的Project和App的区别
    Python处理PDF和Word文档常用的方法(二)
  • 原文地址:https://www.cnblogs.com/liuling/p/asdfasdf.html
Copyright © 2011-2022 走看看