javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first -凯发k8网页登录

debug - 天道酬勤

   :: 凯发k8网页登录首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  671 随笔 :: 6 文章 :: 256 评论 :: 0 trackbacks
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"); 
            }

在此作下符号,希望对自己加强记忆,对同行的朋友提供方便.^_^
posted on 2009-03-20 17:31 huikk 阅读(12583) 评论(14)     所属分类: exceptions
# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first[未登录] 2009-05-15 20:57
找遍了google,baidu,发现还是兄弟的这个方法用效。赞一下
  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2009-05-16 08:07
呵呵,谢谢兄弟~~~  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2009-06-19 09:45
我也赞一个,非常感谢!呵呵  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2009-07-09 09:53
谢谢,很好,
但是我知道为什么要这么做,这么做是什么意思,你能说明一下吗!  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2009-07-09 13:24 惠万鹏
发送邮件默认是25端口,但是gmail邮件服务商用的不是25端口,而是465端口.  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2009-07-09 13:24 惠万鹏
@李超
发送邮件默认是25端口,但是gmail邮件服务商用的不是25端口,而是465端口.
  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2009-07-15 22:36
我也出现过这个问题,现已解决。发送邮件默认是25端口,但是gmail邮件服务商用的不是25端口,而是465或587端口.  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2009-08-26 18:06
非常感谢!
  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first[未登录] 2009-10-17 19:10
不错,刚好也出现这个问题,解决  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2009-12-23 19:13
真是太感谢了!  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2010-03-18 15:03
真是太感谢了,网上讲这个的很多,可以全不行。。。原来是要加几行代码。
但不知道为什么要加这几行呢?楼主能不能指点一下。  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2010-07-14 18:43
太感谢了。  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first 2010-12-23 10:18
谢谢了 我也是这种情况
解决了
我用了 qq邮箱 新浪邮箱都不能发送
gmail可以

谁知道其他的可以的嘛  回复  
  

# re: javax.mail.messagingexception: 530 5.7.0 must issue a starttls command first[未登录] 2011-07-27 17:58
@华子
我知道163 和qq 等其他邮箱发送邮件的方式,偏偏这个gmail竟然发送不了 host和port都对上号了  回复  
  

网站地图