javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first

javax.mail.MessagingException:  530   5.7 . 0  Must issue a STARTTLS command first. u12sm73042tia. 38

    at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:
879 )
    at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:
599 )
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:
319 )
    at com.roadway.edmail.util.JMail2.sendMail(JMail2.java:
278 )
    at com.roadway.edmail.bo.feedback.FeedbackSender.sender(FeedbackSender.java:
72 )
    at org.apache.jsp.test_jsp._jspService(test_jsp.java:
59 )
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:
70 )
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:
717 )
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
374 )
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
342 )
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:
267 )
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:
717 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
290 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206 )
    at com.roadway.edmail.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:
20 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
235 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206 )
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:
164 )
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:
141 )
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:
90 )
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:
417 )
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
235 )
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206 )
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
233 )
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
191 )
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
128 )
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
102 )
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109 )
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
286 )
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
845 )
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:
583 )
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447 )
    at java.lang.Thread.run(Thread.java:
619 )

解决方法:
if ( this .smtp.indexOf( " smtp.gmail.com " ) >= 0 )
            
{
                properties.setProperty(
"mail.smtp.socketFactory.class""javax.net.ssl.SSLSocketFactory"); 
                properties.setProperty(
"mail.smtp.socketFactory.fallback""false"); 
                properties.setProperty(
"mail.smtp.port""465"); 
                properties.setProperty(
"mail.smtp.socketFactory.port""465"); 
            }

在此作下符号,希望对自己加强记忆,对同行的朋友提供方便.^_^
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值