• 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加上引号就可以了。

  • 相关阅读:
    HNOI2014
    HNOI2018
    HNOI2015
    HNOI2016
    Luogu4099 HEOI2013 SAO 组合、树形DP
    CF915G Coprime Arrays 莫比乌斯反演、差分、前缀和
    CF1110H Modest Substrings AC自动机、DP
    CF1110E Magic Stones 差分
    CentOS 7 配置OpenCL环境(安装NVIDIA cuda sdk、Cmake、Eclipse CDT)
    LeetCode(134) Gas Station
  • 原文地址:https://www.cnblogs.com/liuling/p/asdfasdf.html
Copyright © 2020-2023  润新知