access denied for CreateObject("Outlook.Application")
-
Hi all, I have used this code for sending mail using Outlook but its giving access denied problem <% function SendMessages() ' Dim MyDB As Database 'Dim MyRS As Recordset 'Dim objOutlook As Outlook.Application set objOutlook = CreateObject("Outlook.Application") set objOutlookMsg = CreateObject("Outlook.MailItem") set objOutlookRecip = CreateObject("Outlook.Recipient") set objOutlookAttach = CreateObject("Outlook.Attachment") Dim TheAddress Dim ThePhone Dim SendEmail Dim SendPhone Set MyDB = CurrentDb Set MyRS = MyDB.OpenRecordset("tblMailingList") MyRS.MoveFirst ' Create the Outlook session. 'Set objOutlook = CreateObject("Outlook.Application") end function %>
-
Hi all, I have used this code for sending mail using Outlook but its giving access denied problem <% function SendMessages() ' Dim MyDB As Database 'Dim MyRS As Recordset 'Dim objOutlook As Outlook.Application set objOutlook = CreateObject("Outlook.Application") set objOutlookMsg = CreateObject("Outlook.MailItem") set objOutlookRecip = CreateObject("Outlook.Recipient") set objOutlookAttach = CreateObject("Outlook.Attachment") Dim TheAddress Dim ThePhone Dim SendEmail Dim SendPhone Set MyDB = CurrentDb Set MyRS = MyDB.OpenRecordset("tblMailingList") MyRS.MoveFirst ' Create the Outlook session. 'Set objOutlook = CreateObject("Outlook.Application") end function %>
Because your asp.net dont have permission to acces the Outlook Application. for that in "Run" type
dcomcnfg
and press enter. now go to Component Services -> Computer -> My Computer -> DCOM Config. then find your "Microsoft Outlook Application". righ click and select "Property". go to Security -> Access Permission -> Customize -> Edit. Now add "Everyone" and Allow both the options ticked. Note : You can search on internet for specific accounts instead of giving access to everyone. I think you can try just "ASPNET", But I am not sure. And why you want to send mail using Outlook. you can use inbuilt classes in .net framework. that is much easier and less resource hungry. MS Office integration will eat up your resource. also there is very difficult to distroy the object. After running this if you see your Taskbar. you will see many running instance of Outlook.exe. that you cannot stop from your web application. I have used Excel so I know this problem. -
Hi all, I have used this code for sending mail using Outlook but its giving access denied problem <% function SendMessages() ' Dim MyDB As Database 'Dim MyRS As Recordset 'Dim objOutlook As Outlook.Application set objOutlook = CreateObject("Outlook.Application") set objOutlookMsg = CreateObject("Outlook.MailItem") set objOutlookRecip = CreateObject("Outlook.Recipient") set objOutlookAttach = CreateObject("Outlook.Attachment") Dim TheAddress Dim ThePhone Dim SendEmail Dim SendPhone Set MyDB = CurrentDb Set MyRS = MyDB.OpenRecordset("tblMailingList") MyRS.MoveFirst ' Create the Outlook session. 'Set objOutlook = CreateObject("Outlook.Application") end function %>
Why would you need to use outlook on the server ? You realise this won't use outlook on your users machine, right ?
Christian Graus Driven to the arms of OSX by Vista.
-
Why would you need to use outlook on the server ? You realise this won't use outlook on your users machine, right ?
Christian Graus Driven to the arms of OSX by Vista.