e-mail list

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emandel
    New Member
    • Dec 2006
    • 65

    e-mail list

    If I would like to send an identical e-mail to all of the contacts in my contacts table (the ones who have e-mail addresses). I would like this to be in the BCC Field and not in the To: field

    A. Should I do this from within access? if so how?

    B. Should I do this from within Outlook? if so how?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    If you do this in Access you will most likely get a security warning asking you to allow the changes.

    You might not get it in Outlook.

    As for actually doing it, you want to take a look at the recipients object.

    Comment

    • MGrowneyARSI
      New Member
      • Aug 2007
      • 90

      #3
      Private Sub Send_Email_Clic k()
      'On Error GoTo Err_Send_Email_ Click
      Dim rec, a
      Dim mysql$, num2proc%
      Dim strMsg As String
      Dim oLook As Object
      Dim oMail As Object
      Dim stDocName As String
      Dim strEmail, strBCC 'strSubject, strMessage, strBCC
      'strSubject = Forms!send_emai ls!Subject
      'strMessage = Forms!send_emai ls!Email_Body

      Set rec = Nothing
      mysql$ = "SELECT * FROM Mail_Merge WHERE (([Do_Action])= " & True & ")"
      Set rec = CurrentDb.OpenR ecordset(mysql$ , dbOpenDynaset)
      If Not rec.BOF Then rec.MoveFirst
      If rec.EOF And IsNull(rec.emai l) Then
      Set rec = Nothing
      MsgBox "No emails to send"
      Exit Sub
      End If
      Do While Not rec.EOF
      If Len(strBCC) > 0 Then
      strBCC = strBCC & "; " & rec!email
      Else
      strBCC = rec!email
      End If
      rec.Edit
      rec!Do_Action = False
      'rec!Email_ID = Forms!send_emai ls!Email_ID
      rec.Update
      If Not rec.EOF Then
      rec.MoveNext
      Else
      Exit Do
      End If
      Loop
      Set rec = Nothing
      strEmail = DLookup("[Email]", "Users", "[Name] = " & "'" & [Forms]![Login]![AskName] & "'")
      If IsNull(strEmail ) Then
      strEmail = "joseph.growney @accessreadysol ution.com"
      End If
      If Len(Me.Attachme nt) > 0 Then
      stDocName = Me.Attachment
      a = Mid(stDocName, 1, 1)
      If a = "#" Then stDocName = Mid(stDocName, 2, Len(stDocName) - 2)
      Set oLook = CreateObject("O utlook.Applicat ion")
      Set oMail = oLook.createite m(0)
      With oMail
      .to = strEmail
      .body = Forms!send_emai ls!Send_Emailsu b!Email_Body
      .Subject = Forms!send_emai ls!Send_Emailsu b!Subject
      .attachments.Ad d stDocName
      .bcc = strBCC
      .display '.Send
      End With
      Set oMail = Nothing
      Set oLook = Nothing
      Else
      Set oLook = CreateObject("O utlook.Applicat ion")
      Set oMail = oLook.createite m(0)
      With oMail
      .to = strEmail
      .body = Forms!send_emai ls!Send_Emailsu b!Email_Body
      .Subject = Forms!send_emai ls!Send_Emailsu b!Subject
      .bcc = strBCC
      .display
      '.Send
      End With
      Set oMail = Nothing
      Set oLook = Nothing
      End If
      Exit_Send_Email _Click:
      Exit Sub
      Err_Send_Email_ Click:
      MsgBox Err.Description
      Resume Exit_Send_Email _Click

      End Sub



      This is what I use It builds the Bcc based off of a subform in datasheet view and selects the users with bolean fields set to true then gets the body and subject from another form and sends the email here is the original code aswell the code above is slightly moded



      'Use this to send Email from outlook with attachments

      Dim strEmail As String
      Dim strMsg As String
      Dim oLook As Object
      Dim oMail As Object

      Set oLook = CreateObject("O utlook.Applicat ion")
      Set oMail = oLook.createite m(0)
      With oMail
      .to = "someone@email. com"
      .body = "Attached is a PDF file for your viewing"
      .Subject = "Job Item"
      .Attachments.Ad d ("C:\Documen ts and
      Settings\ron_m\ Desktop\rptJobI temStat.pdf")

      '***** ".Display" is the command to preview instead of send *********
      .Send

      End With

      Set oMail = Nothing
      Set oLook = Nothing
      End Function

      Comment

      Working...