1

Topic: Automatic sending of letters Lotus Notes

There is a script for automatic sending of messages from Lotus Notes 8.5.3:

Set Session = CreateObject ("Lotus. NotesSession")
Call Session. Initialize ("password")
Set Maildb = Session. GETDATABASE ("", "C:\Program Files\lotus\notes\data\bookmark.nsf")
If Not Maildb. IsOpen = True Then
Call Maildb. Open
End If
Set MailDoc = Maildb. CREATEDOCUMENT
Call MailDoc. ReplaceItemValue ("Form", "Memo")
Call MailDoc. ReplaceItemValue ("SendTo", "address")
Call MailDoc. ReplaceItemValue ("CopyTo", "address")
Call MailDoc. ReplaceItemValue ("BlindCopyTo", "address")
Set Body = MailDoc. CREATERICHTEXTITEM ("Body")
Call Body. APPENDTEXT ("the letter text")
Call Body. ADDNEWLINE (2)
Call Body. EMBEDOBJECT (1454, "", "a nesting file")
MailDoc. SAVEMESSAGEONSEND = True
Call MailDoc. ReplaceItemValue ("PostedDate", Now ())
Call MailDoc. SEND (True)
Set MailDoc = Nothing
Set Body = Nothing
Set Maildb = Nothing
Set Session = Nothing

The moderator: we Learn to use tags of design of the code - FAQ
Script actually working and messages go, BUT are not saved in the sent. In what there can be a reason?

2

Re: Automatic sending of letters Lotus Notes

You use MAPI  purely as transport - from what to the letter to get to the sent? Try to save the letter in the necessary folder explicitly (that-thread type Call MailDoc. Save (folder)).

3

Re: Automatic sending of letters Lotus Notes

Thanks, and here still a question.
In line "SendTo" it is necessary to specify some addressees how to enumerate some addresses? Or to create an array, but how?

4

Re: Automatic sending of letters Lotus Notes

Ressyx wrote:

In line "SendTo" it is necessary to specify some addressees how to enumerate some addresses?

In any way.
If addressees a little - specify them in the second parameter of method Send (in the form of a string array). Also consider that thus value SendTo is not added to them, and completely ignored.
The example 4 see here .