0

I have an XPage with a view control. On that view control, I have a checkbox selection so that one or more documents can be selected. On the same view control, there is a button. Under the button, I call SSJS that creates a document and saves the newly created document, and then renders the newly created to the user view an XPage. (not sure this matters, but the newly created document is a mail message with Subject, SendTo, CopyTo, From, Form, etc). On the newly saved document, there is then another button that calls a lotuscript agent via the following:

document1.save(); 
var id = document1.getDocument().getNoteID(); 
var agent = database.getAgent("(SendMemo)"); 
agent.run(id) 

(SendMemo) is very simple , with the following code:

on error goto errorlog
dim s as new notessession 
set db = session.currentdatabase 
dim agent as NotesAgent 
set agent = session.CurrentAgent 
dim UNID as string 
UNID= agent.ParameterDocID; 
dim mydoc as notesdocument 
set mydoc = db.getDocumentByID(UNID) 
mydoc.sendDaily= "No" 
call mydoc.ConvertToMIME(2) 
Call mydoc.save ( true, false) 
call mydoc.send(False) **************** 
Exit sub 
errorlog: 
.....
end sub 

If no changes are made to the mail message, it mails correctly without issue. If however, any text is altered, the agent does not finish (fails at *****) and the error is

"Notes error: The Cryptographic key was not found"

I have tried the following variations:

call mydoc.send ( true) 
call mydoc.send ( false, recipient) 

ANY ideas?? I don't have encryption turned on for my mail file. The only thing that I see is " Sign messages that I send" but that is checked but grayed out so cannot change.

Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67

1 Answers1

1
  • you don't need an LS agent to send an email only slows you down. Use SsJS
  • check for your settings. Notes looks for an encryption key to sign if the sign or encryption is set (see the memo form in mail)
stwissel
  • 20,110
  • 6
  • 54
  • 101