Forum Discussion

marklbdrummer's avatar
marklbdrummer
Copper Contributor
Jan 21, 2024

Sending Email

Send email problem    when i display the email to check it.  i click on "Send" the email doesn't appear in my inbox.   Below is the code i am using  Any help would be greatly appreciated.

Private Sub Command228_Click()
Dim oApp As Outlook.Application
Dim oMail As MailItem
Set oApp = CreateObject("Outlook.application")

Set oMail = oApp.CreateItem(olMailItem)
oMail.Body = "Hi All" & vbCrLf & vbCrLf & _
"I have a casino in:" & " " & Me.Venue_City & vbCrLf & _
"Show Time:" & " " & Me.Show_Time & " " & "Event Time:" & " " & Me.Party_Time & vbCrLf & vbCrLf & _
Me.Blackjack & " " & "(" & "Blackjack" & ")" & vbCrLf & _
Me.Craps & " " & "(" & "Craps" & ")" & vbCrLf & _
Me.Roulette & " " & "(" & "Roulette" & ")" & vbCrLf & _
Me.Poker & " " & "(" & "Poker" & ")" & vbCrLf & _
Me.[3 Card Poker] & " " & "(" & "3 Card Poker" & ")" & vbCrLf & _
Me.[Let it Ride] & " " & "(" & "Let it Ride" & ")" & vbCrLf & _
Me.[Pai Gow] & " " & "(" & "Pai Gow" & ")" & vbCrLf & _
Me.[Money Wheel] & " " & "(" & "Money Wheel" & ")" & vbCrLf & vbCrLf & vbCrLf & _
"Stacie Noseworthy PCA" & vbCrLf & _
"Vice President" & vbCrLf & _
"CCP Events Inc" & vbCrLf & _
"1540 Westfork Dr. Suite 108" & vbCrLf & _
"Lithia Springs, GA 30122"

 

oMail.Subject = "New Event Sign-Up"
oMail.To = "email address removed for privacy reasons"
oMail.Display
Set oMail = Nothing
Set oApp = Nothing
End Sub

  • This may not be the problem, but it sure does not look good when you're mixing early binding and late binding.
    Change to:
    Set oApp = New Outlook.Application

    Assuming oMail.To is set to your email address, it should be sent (briefly show in your outbox) when you click Send, and shortly thereafter show in your inbox. It did for me.
    This assumes no spam filter intervened.
    You can also Save the email while previewing it, and it should show in your Drafts folder.
  • This may not be the problem, but it sure does not look good when you're mixing early binding and late binding.
    Change to:
    Set oApp = New Outlook.Application

    Assuming oMail.To is set to your email address, it should be sent (briefly show in your outbox) when you click Send, and shortly thereafter show in your inbox. It did for me.
    This assumes no spam filter intervened.
    You can also Save the email while previewing it, and it should show in your Drafts folder.
    • marklbdrummer's avatar
      marklbdrummer
      Copper Contributor
      Thank you Thats seems to be the answer. Would you happen to know how to create a group to email to?
      • Tom_van_Stiphout's avatar
        Tom_van_Stiphout
        Steel Contributor
        In the desktop version of Outlook (note: not New Outlook): Contacts > New Contact Group.

Share