0
votes

Mail Send Error : Exception occurred calling method NotesDocument.send() null

While making the mime mail in ssjs I am having this issue, but in the Lotus script client, I am getting mime emails correctly. Please help

var docEmail:NotesDocument = database.createDocument();

var rtitem:NotesRichTextItem = docEmail.createRichTextItem("Body");

docEmail.replaceItemValue("Form", "Memo");

docEmail.replaceItemValue("SendTo", "mailid.com");

docEmail.replaceItemValue("Subject", "Your Subject");

rtitem.appendText("Some text here... ");

rtitem.addNewLine(2);

rtitem.appendText("Click here to view the document => ");

//rtitem.appendDocLink(doc, "Some comment text");

rtitem.addNewLine(2);

docEmail.send(); 
2
Welcome to Stack Overflow. Check the XPages log files for a detailed description of the null pointer exception and let us know what the error is. I assume that "mailid.com" is not the actual email address because that can definitely explain why sending the mail fails.Per Henrik Lausten
thanks Per Henrik Lausten.Raja
Plese, find the code I used now. this one also having the same issue.Raja
Exception Error while executing JavaScript action expression Script interpreter error, line=23, col=14: [TypeError] Exception occurred calling method NotesDocument.send() null at [/ssjs_QuoteSent.jss].sendDocument([email protected],,,,) at [/ssjs_QuoteSent.jss].Quote_To_Mail(C4C0F25412F13E704425819E001A1219)Raja
function Quote_To_Mail(docunid) { sendDocument("[email protected]","","","","") }Raja

2 Answers

1
votes

Problem could be that the user that is sending the email doesn't have a mailbox on the server or the path is wrong. I don't know if this has effect on XPages but is does on Agents adding this to Notes.ini or you could try to use SessionasSigner instead.

AMgr_DisableMailLookup=1

0
votes

This is sending a Rich Text email, not a MIME email. If you want to send MIME emails in SSJS, look at this XSnippet https://openntf.org/XSnippets.nsf/snippet.xsp?id=create-html-mails-in-ssjs-using-mime.

If you want "doc links" you can generate an HTML link with the relevant URL. To open it in Notes, use notes://serverName/dbPath/designElement.

I'm not sure if you're including everything in the question, but the sendTo address is not a valid email address there. I assume you've not included everything, but that would definitely cause it to fail.