hi,
i'm a bit stuck here in sending emails to multiple users which i need to read from a database. With codes below, i able only to send 2 recipients. any idea how to send to multiple users?
thx
- strSubject = "Test Memo sent at" & Now()
-
-
strDest = "email"
-
strCopy = "copy_email"
-
-
-
-
Set Session = CreateObject("Notes.NotesSession") ' Creates a Notes Session
-
Server$ = Session.GETENVIRONMENTSTRING("MailServer", True) ' Read the current mail server from Notes.ini
-
Mailfile$ = Session.GETENVIRONMENTSTRING("MailFile", True) ' Read the current mail file from Notes.ini
-
Set DB = Session.GETDATABASE(Server$, Mailfile$) ' Try to open the mail Database
-
-
If Not DB.IsOpen Then
-
MsgBox "Could not access Notes mail file!" ' If Mail db not accessible, return an error
-
Exit Sub
-
End If
-
-
-
Set Memo = DB.CREATEDOCUMENT 'Create a memo in the User 's mail file
-
Memo.Form = "Memo" 'Set the form to be a mail Memo
-
Memo.from = Session.username 'Set the from field (not necessary)
-
Memo.sendto = strDest 'Set the recipient of the Memo
-
Memo.copyto = strCopy
-
Memo.subject = strSubject 'Give the memo a subject
-
-
-
Set Item = Memo.CREATERICHTEXTITEM("Body")
-
'Call Item.EMBEDOBJECT(1454, "", strFilename) 'Go to the body of the memo and embed the attachement
-
Call Memo.Save(True, False) 'Save the memo in drafts
-
Call Memo.send(False, False) 'Send the memo
-
-
-
Set Memo = Nothing
-
Set DB = Nothing
-
Set Session = Nothing
-
-
-
MsgBox "Attachment sent. You may close Notes."