I've been trying to send email messages in VB.Net with no luck. I have seen examples of doing so, but can't get them to work.
My computer is running XP Pro.
The code is ...
Imports System
Imports System.Reflection
Imports System.Web.Mail
Imports System.Windows.Forms
Module ModEmail
Public golapp As Outlook.Application
Public golNameSpace As Outlook.NameSpace
Sub SendTheMail()
Dim oApp As Outlook.Application
Dim omail As Outlook.MailItem
oApp = New Outlook.Application()
omail = oApp.CreateItem(Outlook.OlItemType.olMailItem)
omail.To = "
Someone@abc.com"
omail.Subject="Trying to send email"
omail.Body="This is the body"
omail.Send()
omail = Nothing
oApp = Nothing
End Sub
End Module
I get the squiggly line under omail.send() with the following error buring the build;
'Send' is ambiguous across the inherited interfaces 'Outlook._MailItem' and 'Outlook.ItemEvents_10_Event'.
Thanks for any help,
Carl