Results 1 to 4 of 4
  1. #1
    jhrBanker is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2009
    Posts
    68

    Sending Mail to Multiple Recipients using SENDOBJECT

    I need to send cc's to multiple people on the following line.
    strMgrEmail = rs2.MgrEmail
    In addition to rs2.MgrEmail, I also want to cc rs2.AdmMgr and rs2.WsMgr
    but I'm not sure how to modify the strMgrEmail = rs2.MgrEmail line
    Any help will be greatly appreciated.
    jr


    Private Sub cmdSendRem1_Click()
    Dim dbs As Database
    Dim rs1 As Recordset
    ' Dim rs2 As Recordset
    Dim RecCnt As Integer
    Set dbs = CurrentDb()
    Set rs1 = dbs.OpenRecordset("LogRem")
    Set rs2 = dbs.OpenRecordset("qryTmpRem1")
    RecCnt = 0
    ' On Error GoTo Dberror

    rs2.MoveFirst
    Do Until rs2.EOF
    If rs2.Notify <> 0 Then
    With rs1
    .AddNew
    !Week = rs2.Week
    !LogonID = rs2.LogonID
    !MessSent = Me.txtMessDate2
    !MessNbr = rs2.MessNbr
    !Period = rs2.Period


    !Reason = rs2.Reason
    !Associate = rs2.Associate
    !AdmMgr = rs2.AdmMgr
    !WsMgr = rs2.WsMgr
    !SchHrs = rs2.SchHrs
    !ActHrs = rs2.ActHrs
    !AdmLvl = rs2.AdmLvl
    !Notify = rs2.Notify
    !NOTcd = rs2.NOTcd
    .Update
    .Clone
    End With
    Dim strMess As String
    strAssEmail = rs2.eMail
    strMgrEmail = rs2.MgrEmail
    strBccEmail = "Constant1@aol.com"
    strGreeting = rs2.Greeting
    strMessNbr = rs2.MessNbr
    strPeriod = rs2.Period
    strAssociate = rs2.Associate
    strWsEmail = rs2.WsEmail
    strSchHrs = rs2.SchHrs
    strActHrs = rs2.ActHrs
    strSubj = "RMP" & strMessNbr & " Reminder to: " & strGreeting
    strMess = "Associate Name: " & [strGreeting] & Chr$(13) & Chr$(13) _
    & "Reporting Period: " & [strPeriod] & Chr$(13) & Chr$(13) _
    & "Scheduled Hours: " & [strSchHrs] & Chr$(13) & Chr$(13) _
    & "Hours Recorded: " & [strActHrs] & Chr$(13) & Chr$(13) _
    & Chr$(13) & Chr$(13) _
    & rs2.L01 & Chr$(13) _
    & rs2.L02 & Chr$(13) _
    & rs2.L03
    DoCmd.SendObject , , _
    acFormatRTF, _
    strAssEmail, _
    strMgrEmail, _
    strBccEmail & ";Constant2@aol.com", _
    strSubj, _
    strMess, False, False

    RecCnt = RecCnt + 1
    End If
    rs2.MoveNext
    Loop
    rs2.Close

    Requery

    MsgBox RecCnt & " First Reminders Sent. ", vbInformation

    ' DoCmd.Close
    ' Forms.frmMainMenu.Visible = True

    CurrentDb.Execute "DELETE * FROM tmpRem1;"
    Requery
    Exit Sub

    Dberror:
    If Err = 3021 Then
    MsgBox "There are no messages to send. "
    DoCmd.Close
    Forms.frmMainMenu.Visible = True
    Else
    MsgBox "There was an error adding the record. Error# " _
    & Err.Number & ", " & Err.Description
    End If
    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Along the lines of:

    strMgrEmail = rs2.MgrEmail & ";" & OtherAddress & ";" & AnotherAddress
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jhrBanker is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2009
    Posts
    68
    Thanks for the quick response.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Combining 'sending mail' with 'sending a report'.
    By Mattbro in forum Programming
    Replies: 2
    Last Post: 11-25-2012, 07:42 AM
  2. Replies: 2
    Last Post: 09-29-2011, 10:57 AM
  3. Replies: 11
    Last Post: 09-12-2011, 11:30 AM
  4. Replies: 1
    Last Post: 11-17-2010, 11:24 AM
  5. Replies: 2
    Last Post: 08-17-2010, 10:54 AM

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