Results 1 to 4 of 4
  1. #1
    lukascollings is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    5

    I have created an automated email sender but I need to send it to multiple users

    So I have created the code below and bascally when I click a button an email will be sent to the selected row. However I want to make it so that it automatically goes to the next row and sends an email to that user. I tried a loop code but that only sent the email to the first email account numerous times (it was a little ridiculous to be honest). Any help with how to code this would be greatly appreciated.



    Code:
    Private Sub Command18_Click()       
        Dim OutApp As Object
        Dim OutMail As Object
        Dim strto As String, strcc As String, strbcc As String
        Dim strsub As String, strBody As String
    
    
        Set OutApp = CreateObject("Outlook.Application")
        Set OutMail = OutApp.CreateItem(0)
    
    
        strto = [email]
        strcc = ""
        strbcc = ""
        strsub = "test"
        strBody = "test"
    
    
        With OutMail
            .To = strto
            .CC = strcc
            .BCC = strbcc
            .Subject = strsub
            .Body = strBody
            .Display
        End With
    
    
        Set OutMail = Nothing
        Set OutApp = Nothing
    End Sub
    Click image for larger version. 

Name:	Access.png 
Views:	10 
Size:	104.9 KB 
ID:	22746

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

  3. #3
    lukascollings is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    5
    Have you used website this before to create an access email database?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Yes, but I used CDO and not Outlook.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Send Multiple Attachmen in one Email
    By Skhaliq in forum Access
    Replies: 2
    Last Post: 09-10-2015, 05:16 AM
  2. Send Multiple report in one email
    By Kmahraz in forum Programming
    Replies: 9
    Last Post: 08-20-2015, 12:56 PM
  3. Send Multiple csv attachments by email
    By shaunacol in forum Import/Export Data
    Replies: 16
    Last Post: 07-20-2015, 12:22 PM
  4. Send email to multiple recipients based on query
    By nablmm in forum Programming
    Replies: 3
    Last Post: 09-11-2014, 05:36 PM
  5. send multiple email...code having problem.
    By wnicole in forum Access
    Replies: 15
    Last Post: 10-17-2013, 11:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums