Microsoft.Office.Interop.Outlook.Application

S

Stephen Noronha

Hi,

I am trying a sample app to send an email from my app
I am getting a "type not defined error"
I have added "Office and Outlook" COM component but still I am getting this
error...
Please advice,
Stephen


Public Sub test()
Dim oApp As Microsoft.Office.Interop.Outlook.Application <- type not defined
oApp = New Microsoft.Office.Interop.Outlook.Application
Dim oMsg As Microsoft.Office.Interop.Outlook.MailItem

oMsg =
CType(oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem
), Microsoft.Office.Interop.Outlook.MailItem)()

oMsg.Subject = "Hello!!!"
oMsg.Body = "Hello World"
oMsg.To = (e-mail address removed)
oMsg.Send()

End Sub
 
L

Lucas Tam

Hi,

I am trying a sample app to send an email from my app
I am getting a "type not defined error"
I have added "Office and Outlook" COM component but still I am getting
this error...
Please advice,
Stephen


Do you have Office installed on your server?

Also... do you have to use the Interop components? Might be better to send
through the basic mail classes - it'll definately be more reliable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top