2016-03-23 15:31题主

使用Mailer发送邮件报 - Not connected


如上图配置,运行时报错。

java.lang.IllegalStateException: Not connected
    at com.sun.mail.smtp.SMTPTransport.checkConnected(SMTPTransport.java:1817)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:693)
    at com.smartbuilder.tool.MailObject.send(MailObject.java:89)
    at com.smartbuilder.controls.Mailer.create(Mailer.java:13)
    at com.smartbuilder.common.Parser.createChildren(Parser.java:455)
    at com.smartbuilder.common.Parser.parse(Parser.java:357)
    at com.smartbuilder.common.BizRun.service(BizRun.java:171)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
2016-03-23 15:33#1
以上例子是根据 http://www.geejing.com/main?xwl=browse&id=23UGH61ZTEKB 做的
2016-03-23 16:21#2
smtp没有配置,
可以参考wb7带的邮件发送例子
2016-04-25 11:06#3
支持SSL加密么?现在很多邮箱已经不支持SMTP25端口了。
2016-04-26 10:11#4
mailer控件可以支持 javamail有这个功能

返回开发者社区