问题描述
javax.mail.MessagingException:UnknownSMTPhost:mail02.secpg.com;nestedexceptionis:java.net.UnknownHostException:mail02.secpg.comatcom.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1225)atcom.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:322)atjavax.mail.Service.connect(Service.java:236)atjavax.mail.Service.connect(Service.java:137)atjavax.mail.Service.connect(Service.java:86)atjavax.mail.Transport.send0(Transport.java:150)atjavax.mail.Transport.send(Transport.java:80)atcn.edu.tongji.cims.wade.peoplemanagement.EmailSender.sendMail(EmailSender.java:268)atcn.edu.tongji.cims.wade.navigator.AddProjectDialog$6$1.run(AddProjectDialog.java:850)atorg.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)atorg.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)atorg.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)atorg.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)atorg.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:158)atorg.eclipse.jface.operation.ModalContext.run(ModalContext.java:326)atorg.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:479)atcn.edu.tongji.cims.wade.navigator.AddProjectDialog.buttonPressed(AddProjectDialog.java:430)atorg.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)atorg.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)atorg.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)atorg.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)atorg.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)atorg.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)atorg.eclipse.jface.window.Window.runEventLoop(Window.java:820)atorg.eclipse.jface.window.Window.open(Window.java:796)atcn.edu.tongji.cims.wade.action.CreateProjectAction$1.run(CreateProjectAction.java:59)atorg.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)atcn.edu.tongji.cims.wade.action.CreateProjectAction.run(CreateProjectAction.java:46)atorg.eclipse.jface.action.Action.runWithEvent(Action.java:499)atorg.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)atorg.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)atorg.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)atorg.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)atorg.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)atorg.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)atorg.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)atorg.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)atorg.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)atorg.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)atorg.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)atcn.edu.tongji.cims.wade.Application.run(Application.java:27)atorg.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)atorg.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)atorg.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)atorg.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)atorg.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(UnknownSource)atsun.reflect.DelegatingMethodAccessorImpl.invoke(UnknownSource)atjava.lang.reflect.Method.invoke(UnknownSource)atorg.eclipse.core.launcher.Main.invokeFramework(Main.java:336)atorg.eclipse.core.launcher.Main.basicRun(Main.java:280)atorg.eclipse.core.launcher.Main.run(Main.java:977)atorg.eclipse.core.launcher.Main.main(Main.java:952)有哪位大牛能给解释一下这些异常什么意思???
解决方案
解决方案二:
问题都说明了:"未知的主机异常"--smtp识别不了这个主机javax.mail.MessagingException:UnknownSMTPhost:mail02.secpg.com;nestedexceptionis:java.net.UnknownHostException:mail02.secpg.com一般主机是这样的smpt.gmail.com或smpt.qq.com,smpt.163.com每一种主机都有端口的,都可以再网站查到.普遍是25,但gmail是个特殊的Lz的mail02.secpg.com没见过
解决方案三:
smtp端口的问题?建议楼主去异常网去查查