I have this code, which works great for sending emails. An outlook window opens up, already filled out, and you hit "send"; simple.
However, I would like the code to hit "send" for me.
What/ how could I modify the code below to do this? Or, is there a more efficient code for doing so? This code will just be added to an existing macro.
Thanks for the help!
Sub SEND_EMAIL()
'
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "someone@somewhere.com"
.Subject = "Hi!"
.Body = "How's it going?"
If Send = True Then
.Send
Else
.Display
End If
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Bookmarks