邮件配置如下: 邮件发送报错如下:,有大佬帮忙看下嘛? com.sun.mail.util.MailConnectException: Couldn't connect to host, port: SMTP.qq.com, 25; timeout -1; nested exception is: java.net.UnknownHostException: SMTP.qq.com at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2209) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:740) at javax.mail.Service.connect(Service.java:366) at javax.mail.Service.connect(Service.java:246) at com.fr.base.EmailManager.connect(EmailManager.java:614) at com.fr.base.EmailManager.send(EmailManager.java:495) at com.fr.base.EmailManager.send(EmailManager.java:462) at com.fr.base.EmailManager.send(EmailManager.java:355) at com.fr.base.EmailManager.send(EmailManager.java:345) at com.fr.base.EmailManager.send(EmailManager.java:326) at com.fr.base.EmailManager.send(EmailManager.java:294) at com.fr.base.EmailManager.sendTestMail(EmailManager.java:258) at com.fr.decision.webservice.v10.config.ConfigService.testEmailConnection(Unknown Source) at sun.reflect.GeneratedMethodAccessor1479.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fr.decision.config.ConfigInterceptor.intercept(Unknown Source) at com.fr.decision.webservice.v10.config.ConfigService$$EnhancerByCGLIB$$fb9e39a3.testEmailConnection() at com.fr.web.controller.decision.api.config.EmailResource.testEmail(Unknown Source) at com.fr.web.controller.decision.api.config.EmailResource$$FastClassBySpringCGLIB$$6124e2a1.invoke() at com.fr.third.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:201) at com.fr.third.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:710) at com.fr.third.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at com.fr.third.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) at com.fr.decision.webservice.aspect.DecisionLogAspect.doControllerAround(Unknown Source) at sun.reflect.GeneratedMethodAccessor1470.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fr.third.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) at com.fr.third.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) at com.fr.third.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:69) at com.fr.third.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) at com.fr.third.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at com.fr.third.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at com.fr.third.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:646) at com.fr.web.controller.decision.api.config.EmailResource$$EnhancerBySpringCGLIB$$28f492.testEmail() at sun.reflect.GeneratedMethodAccessor1478.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.fr.third.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at com.fr.third.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at com.fr.third.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at com.fr.third.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:747) at com.fr.third.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:676) at com.fr.third.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at com.fr.third.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) at com.fr.third.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) at com.fr.third.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) at com.fr.third.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863) at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) at com.fr.third.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.fr.decision.base.DecisionServletInitializer$6.doFilterInternal(Unknown Source) at com.fr.third.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.fr.decision.base.DecisionServletInitializer$4.doFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.fr.plugin.sln3611.SlnRequestFilterProvider.doFilter(Unknown Source) at com.fr.decision.base.DecisionServletInitializer$5.doFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.fr.third.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at com.fr.third.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1623) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.net.UnknownHostException: SMTP.qq.com at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:359) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238) at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2175) ... 88 more 补充问题内容: 端口25和465试过,不同加密方式试过。密码用的邮箱客户端授权码。 本地设计器决策系统试了,是可以的,生产上不行。 目前的思路可能和生产的网络环境有关系,但是不知道和哪方面的内容有关系 |