Hello sir thanx for ur reply
If i run that program from file system(i.e. if i save that project in local drive like D,E,F it works well).But if i save in the
iis 7 it show the error like
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)
My project code is
Place one button.In button click event u call the function SendMailOUTLOOK()
Private Sub SendMailOUTLOOK()
Dim a As String
a = "E:\Aravind\fiup\fiup\Image\Koala.jpg"
Dim objOutlk As New Microsoft.Office.Interop.Outlook.Application 'Outlook
Const olMailItem As Integer = 0
Dim objMail As New System.Object
' Start Outlook.
' If it is already running, you'll use the same instance...
Dim olApp As Microsoft.Office.Interop.Outlook.Application----------->>>>Error Show
olApp = CreateObject("Outlook.Application")
objMail = objOutlk.CreateItem(olMailItem) 'Email item
' Logon. Doesn't hurt if you are already running and logged on...
Dim olNs As Microsoft.Office.Interop.Outlook.NameSpace
olNs = olApp.GetNamespace("MAPI")
olNs.Logon()
'Insert your "To" address...it can by dynamically populated
objMail.To = "panchaksharamba@gmail.com"
'Insert your "CC" address...it can by dynamically populated
objMail.cc = "panchaksharamba@gmail.com" 'Enter an address here To include a carbon copy; bcc is For blind carbon copy's
'Set up Subject Line
objMail.subject = "testing web-based email message"
'To add an attachment, use:
objMail.attachments.add(a)
''otherwise, if no attachment, you can comment the objMail.attachments.add("") out with an apostrophe
'Set up your message body
Dim msg As String
msg = ""
objMail.body = msg
'Use this To display before sending, otherwise call (use) objMail.Send to send without reviewing
objMail.display()
'Clean up
objMail = Nothing
objOutlk = Nothing
End Sub
pls reply me just u add reference in the project outlook library
add namespace
Imports System.Reflection
Imports Outlook = Microsoft.Office.Interop.Outlook
Imports Microsoft.Office.Interop
Imports System.Web.Mail
'Imports System.Net.Mail