By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,345 Members | 2,404 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,345 IT Pros & Developers. It's quick & easy.

Sending email from Access to multiple users

P: 22
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
Expand|Select|Wrap|Line Numbers
  1. strSubject = "Test Memo sent at" & Now()
  2.  
  3. strDest = "email"
  4. strCopy = "copy_email"
  5.  
  6.  
  7.  
  8. Set Session = CreateObject("Notes.NotesSession")  ' Creates a Notes  Session
  9. Server$ = Session.GETENVIRONMENTSTRING("MailServer", True)    ' Read the current mail server from Notes.ini
  10. Mailfile$ = Session.GETENVIRONMENTSTRING("MailFile", True)    ' Read the current mail file from Notes.ini
  11. Set DB = Session.GETDATABASE(Server$, Mailfile$)  ' Try to open the mail Database
  12.  
  13. If Not DB.IsOpen Then
  14. MsgBox "Could not access Notes mail file!"    ' If Mail db not accessible, return an error
  15. Exit Sub
  16. End If
  17.  
  18.  
  19. Set Memo = DB.CREATEDOCUMENT                      'Create a memo in the User 's mail file
  20. Memo.Form = "Memo"                                'Set the form to be a mail Memo
  21. Memo.from = Session.username                      'Set the from field (not necessary)
  22. Memo.sendto = strDest                             'Set the recipient of the Memo
  23. Memo.copyto = strCopy
  24. Memo.subject = strSubject                         'Give the memo a subject
  25.  
  26.  
  27. Set Item = Memo.CREATERICHTEXTITEM("Body")
  28. 'Call Item.EMBEDOBJECT(1454, "", strFilename)      'Go to the body of the memo and embed the attachement
  29. Call Memo.Save(True, False)                       'Save the memo in drafts
  30. Call Memo.send(False, False)                      'Send the memo
  31.  
  32.  
  33. Set Memo = Nothing
  34. Set DB = Nothing
  35. Set Session = Nothing
  36.  
  37.  
  38. MsgBox "Attachment sent. You may close Notes."
Jun 6 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.