Send Outlook email via Invoke Code

I have the following code

Dim oApp As Interop.Outlook._Application

oApp = New Interop.Outlook.Application
Dim oMsg As Interop.Outlook._MailItem 
oMsg = oApp.CreateItem(Interop.Outlook.OlItemType.olMailItem)
oMsg.Subject = "Test"
oMsg.Body = "Body"
oMsg.To = "outgoingemail@test.ca"
oMsg.Send() 

I get an error: Interop is not accessible because it is friend. I have microsoft.office.interop.outlook imported.
Any ideas on how to fix?

1 Like

@mkkajtez - I hope the below post helps!

2 Likes