在xpages中发送邮件时出错

时间:2017-11-02 11:13:15

标签: lotus-notes lotus-domino xpages-ssjs

我在xpages中面临一个问题,

我能够成功地在Lotus Notes客户端发送邮件,但在xpages中我收到了以下错误。

我也检查了服务器文档。这一切都与 请帮忙。

*使用的代码:在按钮中单击()ssjs *

var doc:NotesDocument = database.createDocument();  
doc.replaceItemValue("form", "Memo");
doc.replaceItemValue("sendTo", "tuser1@gmail.com");
doc.replaceItemValue("subject", "an email to you");
var RT:NotesRichTextItem=doc.createRichTextItem("Body")
RT.appendText("This is my Text")
RT.addNewLine()
doc.send();

我收到了以下错误。

Error while executing JavaScript action expression
Script interpreter error, line=10, col=5: [TypeError] Exception occurred calling method NotesDocument.send() null

堆栈追踪:

javax.faces.FacesException: Error while executing JavaScript action expression
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:102)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
    com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:256)
    com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:228)
    com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
    com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
    com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
    com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
    com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
    com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
    com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript action expression
    com.ibm.xsp.binding.javascript.JavaScriptMethodBinding.invoke(JavaScriptMethodBinding.java:126)
    com.ibm.xsp.application.ActionListenerImpl.processAction(ActionListenerImpl.java:60)
    javax.faces.component.UICommand.broadcast(UICommand.java:324)
    com.ibm.xsp.component.UIEventHandler.broadcast(UIEventHandler.java:366)
    com.ibm.xsp.component.UIViewRootEx.broadcast(UIViewRootEx.java:1535)
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:307)
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:428)
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:94)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
    com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:256)
    com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:228)
    com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
    com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
    com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
    com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
    com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
    com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
    com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
com.ibm.jscript.InterpretException: Script interpreter error, line=10, col=5: [TypeError] Exception occurred calling method NotesDocument.send()
null
    com.ibm.xsp.script.WrapperDomino$fct_Document.call(WrapperDomino.java:9683)
    com.ibm.jscript.types.FBSObject.call(FBSObject.java:161)
    com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:197)
    com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)
    com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)
    com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)
    com.ibm.jscript.JSExpression.access$1(JSExpression.java:424)
    com.ibm.jscript.JSExpression$2.run(JSExpression.java:414)
    java.security.AccessController.doPrivileged(AccessController.java:362)
    com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)
    com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)
    com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)
    com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:222)
    com.ibm.xsp.binding.javascript.JavaScriptMethodBinding.invoke(JavaScriptMethodBinding.java:111)
    com.ibm.xsp.application.ActionListenerImpl.processAction(ActionListenerImpl.java:60)
    javax.faces.component.UICommand.broadcast(UICommand.java:324)
    com.ibm.xsp.component.UIEventHandler.broadcast(UIEventHandler.java:366)
    com.ibm.xsp.component.UIViewRootEx.broadcast(UIViewRootEx.java:1535)
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:307)
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:428)
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:94)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
    com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:256)
    com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:228)
    com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
    com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
    com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
    com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
    com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
    com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
    com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
NotesException: Notes error: The remote server is not a known TCP/IP host.
    lotus.domino.local.Document.send(Unknown Source)
    lotus.domino.local.Document.send(Unknown Source)
    com.ibm.xsp.script.WrapperDomino$fct_Document.call(WrapperDomino.java:9586)
    com.ibm.jscript.types.FBSObject.call(FBSObject.java:161)
    com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:197)
    com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)
    com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)
    com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)
    com.ibm.jscript.JSExpression.access$1(JSExpression.java:424)
    com.ibm.jscript.JSExpression$2.run(JSExpression.java:414)
    java.security.AccessController.doPrivileged(AccessController.java:362)
    com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)
    com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)
    com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)
    com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:222)
    com.ibm.xsp.binding.javascript.JavaScriptMethodBinding.invoke(JavaScriptMethodBinding.java:111)
    com.ibm.xsp.application.ActionListenerImpl.processAction(ActionListenerImpl.java:60)
    javax.faces.component.UICommand.broadcast(UICommand.java:324)
    com.ibm.xsp.component.UIEventHandler.broadcast(UIEventHandler.java:366)
    com.ibm.xsp.component.UIViewRootEx.broadcast(UIViewRootEx.java:1535)
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:307)
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:428)
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:94)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
    com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:256)
    com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:228)
    com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
    com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
    com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
    com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
    com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
    com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
    com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
    com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
    com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)

请帮助..我尝试了大部分解决方案......但是没有一个解决方案..

2 个答案:

答案 0 :(得分:0)

看起来document.send()实施中存在错误。

根据the documentation尝试使用收件人参数调用send()

代码中的

,而不是doc.send();来电doc.send("tuser1@gmail.com");

如果它仍然不起作用,请尝试此类的每个可用send方法,由我在上面提供的链接描述。

答案 1 :(得分:0)

您是否检查了可能导致此问题的以下内容?

  1. 服务器是否能够(正确配置)发送消息?
  2. 您是否有权(在ACL中)在数据库中创建文档?