I received the following error when I tried to send email from web application although it was working good before , Do you have any idea about that ? and it working in the debug mode of visual studio but is not working through the IIS right now.
“Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.”
As per my understanding this error is related to access denied of IIS to outlook object but i try to find solution for that in google : the solution is to make permission to IIS-USRs account for the outlook but I don’t know how to do that So, i try to find MS-OUTLOOK on dcom to add IIS-USRS but i can't find it could you tell me the exact name of outlook on DCOM.
My Code as below
Dim ol As New Outlook.Application()
Dim ns As Outlook.NameSpace
Try
Dim fdMail As Outlook.MAPIFolder
ns = ol.GetNamespace(MAPI)
ns.Logon(, , True, True)
'creating a new MailItem object
Dim newMail As Outlook.MailItem
'gets defaultfolder for my Outlook Outbox
fdMail = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox)
'assign values to the newMail MailItem
newMail = fdMail.Items.Add(Outlook.OlItemType.olMailItem)
newMail.Subject = RecordtypeDropDownList.Text + Notification
newMail.Body = You got + RecordtypeDropDownList.Text + for + CategoryDropdownList.Text
'newMail.To = EmaildropDownlistEM.Text ' we will pass the email from record missbonus point table in the final stage
newMail.To = Mid(EmaildropDownlistEM.Text, (EmaildropDownlistEM.Text.IndexOf(, )) + 2, 10) + . + Left(EmaildropDownlistEM.Text, EmaildropDownlistEM.Text.IndexOf(, ))
newMail.CC = xxxxxxxxx
newMail.SaveSentMessageFolder = fdMail
newMail.Send()
Catch ex As Exception
Throw ex
End Try