Please see attached example. all details there and noted clearly.
current code:
Sub emailinstant()
Dim OutApp As Object
Dim OutMail As Object
On Error Resume Next
Err.Clear
Set OutApp = GetObject(Class:="Outlook.Application")
If Err <> 0 Then Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "TEST"
.Body = "TEST"
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
end sub
thanks
Bookmarks