The code that I have works quite well, when I want to use a single email address. However if I want to use more, it seems to require an array. No matter what I do I simply cannot get it to recognize more than one address...
If anyone has any insight, and can at least point me in the right direction, I would really appreciate it.
Thanks
Code: Select all
to := ["email1@server.com","email2@server.ca"]
; to.Insert("email2@server.ca")
; to.Insert("email2@server.ca")
; to := "email1@server.com, email2@server.ca"
cc := ""
bcc := ""
notes := ComObjCreate("Lotus.NotesSession")
notes.initialize()
; notes.Initialize("<password>")
Maildb := notes.GETDATABASE("", "D:\Data\Notes\xxxxxxx.nsf")
MailDoc := Maildb.CREATEDOCUMENT
MailDoc.ReplaceItemValue("Form", "Memo")
MailDoc.ReplaceItemValue("SendTo", to)
if (cc)
MailDoc.ReplaceItemValue("CopyTo", cc)
if (bcc)
MailDoc.ReplaceItemValue("BlindCopyTo", bcc)
MailDoc.ReplaceItemValue("Subject", subject)
Body := MailDoc.CREATERICHTEXTITEM("Body")
Body.APPENDTEXT(body)
if (attach) {
MsgBox, attach has text in it
} else {
MsgBox, attach has nothing in it
}
; IfExist, %attach% {
; Body.addNewLine(2)
; Body.EMBEDOBJECT(1454, "", attach, "Attachment")
; }
; IfNotExist, %attach% {
; msgbox, File doesn't exist
; }
MailDoc.SAVEMESSAGEONSEND := True
FormatTime, CurrentDateTime, , MM/dd/yyyy HH:mm:ss
; MsgBox The current time and date (date first) is %CurrentDateTime%.
MailDoc.ReplaceItemValue("PostedDate", CurrentDateTime)
; MailDoc.PostedDate(CurrentDateTime)
MailDoc.SEND(False)