I know this has been posted a bunch of times by others, but after reading all responses, I still can’t find what I am doing wrong. Any help would be greatly appreciated.
I’ve tried to send mail using formula(@mailsend) and Lotus Script(doc.send). It did n’t work out. But it does work fine in the Notes client.
Created an agent with the following code and called that agent in webquerysave agent. And also tried to call the agent thru openagent URL command. I did n’t get mail, though it says “Agent Done”… It is not giving any error message.
Dim session As New NotesSession
Call session.DocumentContext.Send( False, “Test User1” )
Any help would be greatly appreciated.
Thanks in advance!
Subha.
Subject: Okay, try this one…it’s formula language.
Use the Sendmail in the webqueryevent calling the following agent.
msge :=“You have received a message.”;
@MailSend("Your Name";"";"";"Test";msge + " " + Link);
@All
I tested and it works, too!
Subject: RE: Okay, try this one…it’s formula language.
No luck…It is not working on web… The same code is working fine in client perfectly…
Thank you very much for your help Michael.
Subject: Another example.
@Command(FileSave]); @Command(ToolsRunMacro]; “AgentToSend”)
This is the code for your agent:
Sub Initialize
dim s as new notessession
dim db as notesdatabase
dim webdoc as notesdocument
dim rit as notesrichtextitem
set webdoc = s.documentcontext
dim memo as notesdocument
set memo = new notesdocument(db)
Set rit = New NotesRichTextItem(memo, "Body")
call rit.AppendDocLink(webdoc, "Click to see the document")
memo.form = "Memo"
memo.subject = "This is a mail document"
memo.SendTo = "Your Name Here"
call memo.Send(true)
Subject: It did not work!
Thank you very much for the sample code Michael.
It did n’t work… Any idea why?
Thanks
Subha
Subject: Not sure!
I tested the first code I sent and it works fine. You are calling the agent from the webquerysave event correct? And the code looks like this…
@Command([ToolsRunMacro];“SendMail”)
Subject: Yes. I’m calling an agent from webquerysave agent
Subject: Try this one…
Dim MailDoc as NotesDocumentDim Db as NotesDatabase
Dim Doc as NotesDocument
Dim S as New NotesSession
Dim RTItem as NotesRichTextItem
Set Doc = S.DocumentContext
Set Db = S.CurrentDatabase
Set MailDoc = New NotesDocument(Db)
MailDoc.Form = “Memo”
MailDoc.SendTo = “Your Name goes here”
MailDoc.Subject = Doc.Title
Set RTItem = New NotesRichTextItem(MailDoc, “Body”)
Call MailDoc.Send(false)