By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,148 Members | 739 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,148 IT Pros & Developers. It's quick & easy.

Microsoft.Office.Interop.Outlook.Application

P: n/a
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.Out look.OlItemType.olMailItem
), Microsoft.Office.Interop.Outlook.MailItem)()

oMsg.Subject = "Hello!!!"
oMsg.Body = "Hello World"
oMsg.To = me@gmail.com
oMsg.Send()

End Sub
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Stephen Noronha" <st********@hotmail.com> wrote in
news:OL**************@TK2MSFTNGP14.phx.gbl:
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.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.