I
Ivan Weiss
I am trying to send a test e-mail through my program using Outlook so
that I know my code works and I can submit office forms through e-mail
instead of paper. Here is my code:
Dim objOutlook As New Outlook.Application()
Dim objMail As MailItem =
objOutlook.CreateItem(OlItemType.olMailItem)
With objMail
.To = "(e-mail address removed)"
.Subject = "Testing"
.HTMLBody = "<HTML><HEAD></HEAD><BODY bgcolor = 'red'>" _
& "<font color = 'white'>Hello!</font>" _
& "</body></html>"
'.Display()
.Send()
End With
objMail = Nothing
objOutlook = Nothing
I have
Imports Microsoft.Office.Core
Imports Outlook
above my form class
However, the .Send() method returns the following error:
'Send' is ambiguous across the inherited interfaces 'Outlook._MailItem'
and 'Outlook.ItemEvents_10_Event'.
Does anyone know why I am getting this and how I can send my email
without the user having to click on send?
that I know my code works and I can submit office forms through e-mail
instead of paper. Here is my code:
Dim objOutlook As New Outlook.Application()
Dim objMail As MailItem =
objOutlook.CreateItem(OlItemType.olMailItem)
With objMail
.To = "(e-mail address removed)"
.Subject = "Testing"
.HTMLBody = "<HTML><HEAD></HEAD><BODY bgcolor = 'red'>" _
& "<font color = 'white'>Hello!</font>" _
& "</body></html>"
'.Display()
.Send()
End With
objMail = Nothing
objOutlook = Nothing
I have
Imports Microsoft.Office.Core
Imports Outlook
above my form class
However, the .Send() method returns the following error:
'Send' is ambiguous across the inherited interfaces 'Outlook._MailItem'
and 'Outlook.ItemEvents_10_Event'.
Does anyone know why I am getting this and how I can send my email
without the user having to click on send?