Reputation: 279
I have an Asp.net Website which uses outlook dll. I am using the below code
Dim app As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application
Dim mailitem As Microsoft.Office.Interop.Outlook._MailItem = app.CreateItem(OlItemType.olMailItem)
mailitem.To = legRev
mailitem.CC = cc
mailitem.Subject = Subject
mailitem.HTMLBody = "Hi, <br/>"
mailitem.HTMLBody += "<br/> The Deal - " + ClientName + ", has been Assigned to you for Legal Review. <br/><br/>"
mailitem.HTMLBody += "Expected Signature Date : " + SignDate + " <br/>"
mailitem.HTMLBody += "Customer Funding Date : " + FundingDate + " <br/>"
mailitem.HTMLBody += "Financed Amount : " + sFinancedAmount + " <br/><br/>"
mailitem.HTMLBody += "Please, click here to provide your final approval. <br/><br/>"
If innerCC.Length = 0 Then
mailitem.HTMLBody += "<a href=mailto:" + innerTo + "?Subject=" + innerSubject + ">" + PathName + "</a>"
Else
mailitem.HTMLBody += "<a href=mailto:" + innerTo + "?CC=" + innerCC + "&Subject=" + innerSubject + ">" + PathName + "</a>"
End If
mailitem.Display(False)
When I run the code I am getting an error like , 'Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154. '.
I dont have outlook installed. But I have copied the interop.outlook dll to my GAC.
Please help
Upvotes: 0
Views: 1473
Reputation: 66286
Firstly, no Office app (including Outlook) should be used in a service, such as IIS. Secondly, interop.outlook dll is nothing but a glorified header file. You actually need to have Outlook installed to be able to use it.
Upvotes: 1