CDO Error

CDO Error

am 24.10.2007 23:00:24 von Nate

I have the following ASP code on a simple "experimental" page:

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="f...@blah.com"
myMail.To="t...@blah.com"
myMail.CreateMHTMLBody "http://cic/targeted/results.asp"
mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
configuration/sendusing")=2
mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
configuration/smtpserver")="172.30.8.51"
mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
configuration/smtpserverport")=25
mymail.configuration.fields.update
myMail.Send
set myMail=nothing
%>


When attempting to hit this page, I receive:


CDO.Message.1 error '80070005'


Access is denied.


/experiments/emailtest.asp, line 6


I ran LogMon, and found the following error whenever I hit the page:
4:49:37 PM w3wp.exe:2992 OPEN D:\CIC ACCESS DENIED NT
AUTHORITY
\NETWORK SERVICE


I've tried adding the network service user to D:\CIC, but the same
error persists.


Any ideas?

Re: CDO Error

am 24.10.2007 23:32:21 von Anthony Jones

"Nate" wrote in message
news:1193259624.787522.15940@q3g2000prf.googlegroups.com...
> I have the following ASP code on a simple "experimental" page:
>
> <%
> Set myMail=CreateObject("CDO.Message")
> myMail.Subject="Sending email with CDO"
> myMail.From="f...@blah.com"
> myMail.To="t...@blah.com"
> myMail.CreateMHTMLBody "http://cic/targeted/results.asp"
> mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> configuration/sendusing")=2
> mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> configuration/smtpserver")="172.30.8.51"
> mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> configuration/smtpserverport")=25
> mymail.configuration.fields.update
> myMail.Send
> set myMail=nothing
> %>
>
>
> When attempting to hit this page, I receive:
>
>
> CDO.Message.1 error '80070005'
>
>
> Access is denied.
>
>
> /experiments/emailtest.asp, line 6
>
>
> I ran LogMon, and found the following error whenever I hit the page:
> 4:49:37 PM w3wp.exe:2992 OPEN D:\CIC ACCESS DENIED NT
> AUTHORITY
> \NETWORK SERVICE
>
>
> I've tried adding the network service user to D:\CIC, but the same
> error persists.
>

Did you grant read/write access?
What is D:\CIC anyway, a folder or root of the website?
Is this code running on CIC?
If you visit http://cic/targeted/results.asp with a browser does it work?
Do you have ASP debugging turned on?

Having asked that lot, CreateMHTMLBody isn't a safe thing to using in ASP.
Ultimately it will use the WinINet API which is designed to be used by a
client. If you have many such requests running at the same time all sorts
of undesirable things can happen.

--
Anthony Jones - MVP ASP/ASP.NET

Re: CDO Error

am 25.10.2007 01:48:38 von Nate

On Oct 24, 4:32 pm, "Anthony Jones" wrote:
> "Nate" wrote in message
>
> news:1193259624.787522.15940@q3g2000prf.googlegroups.com...
>
>
>
>
>
> > I have the following ASP code on a simple "experimental" page:
>
> > <%
> > Set myMail=CreateObject("CDO.Message")
> > myMail.Subject="Sending email with CDO"
> > myMail.From="f...@blah.com"
> > myMail.To="t...@blah.com"
> > myMail.CreateMHTMLBody "http://cic/targeted/results.asp"
> > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > configuration/sendusing")=2
> > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > configuration/smtpserver")="172.30.8.51"
> > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > configuration/smtpserverport")=25
> > mymail.configuration.fields.update
> > myMail.Send
> > set myMail=nothing
> > %>
>
> > When attempting to hit this page, I receive:
>
> > CDO.Message.1 error '80070005'
>
> > Access is denied.
>
> > /experiments/emailtest.asp, line 6
>
> > I ran LogMon, and found the following error whenever I hit the page:
> > 4:49:37 PM w3wp.exe:2992 OPEN D:\CIC ACCESS DENIED NT
> > AUTHORITY
> > \NETWORK SERVICE
>
> > I've tried adding the network service user to D:\CIC, but the same
> > error persists.
>
> Did you grant read/write access?
> What is D:\CIC anyway, a folder or root of the website?
> Is this code running on CIC?
> If you visithttp://cic/targeted/results.aspwith a browser does it work?
> Do you have ASP debugging turned on?
>
> Having asked that lot, CreateMHTMLBody isn't a safe thing to using in ASP.
> Ultimately it will use the WinINet API which is designed to be used by a
> client. If you have many such requests running at the same time all sorts
> of undesirable things can happen.
>
> --
> Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
>
> - Show quoted text -

Thanks for the response, Anthony.

Read and write access (even full access) was tested and failed. D:\CIC
is the root of the site on the server. Yes, the code is running on
CIC. Yes, the page works properly. I may not have had ASP debugging
turned on, but will try again.

Re: CDO Error

am 25.10.2007 01:52:05 von Nate

On Oct 24, 6:48 pm, Nate wrote:
> On Oct 24, 4:32 pm, "Anthony Jones" wrote:
>
>
>
>
>
> > "Nate" wrote in message
>
> >news:1193259624.787522.15940@q3g2000prf.googlegroups.com...
>
> > > I have the following ASP code on a simple "experimental" page:
>
> > > <%
> > > Set myMail=CreateObject("CDO.Message")
> > > myMail.Subject="Sending email with CDO"
> > > myMail.From="f...@blah.com"
> > > myMail.To="t...@blah.com"
> > > myMail.CreateMHTMLBody "http://cic/targeted/results.asp"
> > > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > configuration/sendusing")=2
> > > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > configuration/smtpserver")="172.30.8.51"
> > > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > configuration/smtpserverport")=25
> > > mymail.configuration.fields.update
> > > myMail.Send
> > > set myMail=nothing
> > > %>
>
> > > When attempting to hit this page, I receive:
>
> > > CDO.Message.1 error '80070005'
>
> > > Access is denied.
>
> > > /experiments/emailtest.asp, line 6
>
> > > I ran LogMon, and found the following error whenever I hit the page:
> > > 4:49:37 PM w3wp.exe:2992 OPEN D:\CIC ACCESS DENIED NT
> > > AUTHORITY
> > > \NETWORK SERVICE
>
> > > I've tried adding the network service user to D:\CIC, but the same
> > > error persists.
>
> > Did you grant read/write access?
> > What is D:\CIC anyway, a folder or root of the website?
> > Is this code running on CIC?
> > If you visithttp://cic/targeted/results.aspwitha browser does it work?
> > Do you have ASP debugging turned on?
>
> > Having asked that lot, CreateMHTMLBody isn't a safe thing to using in ASP.
> > Ultimately it will use the WinINet API which is designed to be used by a
> > client. If you have many such requests running at the same time all sorts
> > of undesirable things can happen.
>
> > --
> > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
>
> > - Show quoted text -
>
> Thanks for the response, Anthony.
>
> Read and write access (even full access) was tested and failed. D:\CIC
> is the root of the site on the server. Yes, the code is running on
> CIC. Yes, the page works properly. I may not have had ASP debugging
> turned on, but will try again.- Hide quoted text -
>
> - Show quoted text -

Yes, debugged was enabled.

Re: CDO Error

am 25.10.2007 10:42:56 von Anthony Jones

"Nate" wrote in message
news:1193269925.442284.128000@e9g2000prf.googlegroups.com...
> On Oct 24, 6:48 pm, Nate wrote:
> > On Oct 24, 4:32 pm, "Anthony Jones" wrote:
> >
> >
> >
> >
> >
> > > "Nate" wrote in message
> >
> > >news:1193259624.787522.15940@q3g2000prf.googlegroups.com...
> >
> > > > I have the following ASP code on a simple "experimental" page:
> >
> > > > <%
> > > > Set myMail=CreateObject("CDO.Message")
> > > > myMail.Subject="Sending email with CDO"
> > > > myMail.From="f...@blah.com"
> > > > myMail.To="t...@blah.com"
> > > > myMail.CreateMHTMLBody "http://cic/targeted/results.asp"
> > > > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > > configuration/sendusing")=2
> > > > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > > configuration/smtpserver")="172.30.8.51"
> > > > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > > configuration/smtpserverport")=25
> > > > mymail.configuration.fields.update
> > > > myMail.Send
> > > > set myMail=nothing
> > > > %>
> >
> > > > When attempting to hit this page, I receive:
> >
> > > > CDO.Message.1 error '80070005'
> >
> > > > Access is denied.
> >
> > > > /experiments/emailtest.asp, line 6
> >
> > > > I ran LogMon, and found the following error whenever I hit the page:
> > > > 4:49:37 PM w3wp.exe:2992 OPEN D:\CIC ACCESS DENIED NT
> > > > AUTHORITY
> > > > \NETWORK SERVICE
> >
> > > > I've tried adding the network service user to D:\CIC, but the same
> > > > error persists.
> >
> > > Did you grant read/write access?
> > > What is D:\CIC anyway, a folder or root of the website?
> > > Is this code running on CIC?
> > > If you visithttp://cic/targeted/results.aspwitha browser does it work?
> > > Do you have ASP debugging turned on?
> >
> > > Having asked that lot, CreateMHTMLBody isn't a safe thing to using in
ASP.
> > > Ultimately it will use the WinINet API which is designed to be used by
a
> > > client. If you have many such requests running at the same time all
sorts
> > > of undesirable things can happen.
> >
> > > --
> > > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
> >
> > > - Show quoted text -
> >
> > Thanks for the response, Anthony.
> >
> > Read and write access (even full access) was tested and failed. D:\CIC
> > is the root of the site on the server. Yes, the code is running on
> > CIC. Yes, the page works properly. I may not have had ASP debugging
> > turned on, but will try again.- Hide quoted text -
> >
> > - Show quoted text -
>
> Yes, debugged was enabled.
>

When debugging is turned on ASP will only use one worker thread to handle
requests. If your ASP code performs an action which generates another
request into the site that request will queue waiting for you ASP code to
complete. However your ASP code won't complete until its received a
response from the second request. Its a deadlock. Eventually the second
request will timeout and you'd get an error, Access denied is not what I
would expect to be the result though.

Do you have anonymous access turned on?

Note having ASP code generate requests to other ASP pages running in the
same application can also be a source of problems when used heavily. You
can end up with deadlock even without debugging turned on.



--
Anthony Jones - MVP ASP/ASP.NET

Re: CDO Error

am 25.10.2007 15:52:04 von Nate

On Oct 25, 3:42 am, "Anthony Jones" wrote:
> "Nate" wrote in message
>
> news:1193269925.442284.128000@e9g2000prf.googlegroups.com...
>
>
>
>
>
> > On Oct 24, 6:48 pm, Nate wrote:
> > > On Oct 24, 4:32 pm, "Anthony Jones" wrote:
>
> > > > "Nate" wrote in message
>
> > > >news:1193259624.787522.15940@q3g2000prf.googlegroups.com...
>
> > > > > I have the following ASP code on a simple "experimental" page:
>
> > > > > <%
> > > > > Set myMail=CreateObject("CDO.Message")
> > > > > myMail.Subject="Sending email with CDO"
> > > > > myMail.From="f...@blah.com"
> > > > > myMail.To="t...@blah.com"
> > > > > myMail.CreateMHTMLBody "http://cic/targeted/results.asp"
> > > > > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > > > configuration/sendusing")=2
> > > > > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > > > configuration/smtpserver")="172.30.8.51"
> > > > > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > > > configuration/smtpserverport")=25
> > > > > mymail.configuration.fields.update
> > > > > myMail.Send
> > > > > set myMail=nothing
> > > > > %>
>
> > > > > When attempting to hit this page, I receive:
>
> > > > > CDO.Message.1 error '80070005'
>
> > > > > Access is denied.
>
> > > > > /experiments/emailtest.asp, line 6
>
> > > > > I ran LogMon, and found the following error whenever I hit the page:
> > > > > 4:49:37 PM w3wp.exe:2992 OPEN D:\CIC ACCESS DENIED NT
> > > > > AUTHORITY
> > > > > \NETWORK SERVICE
>
> > > > > I've tried adding the network service user to D:\CIC, but the same
> > > > > error persists.
>
> > > > Did you grant read/write access?
> > > > What is D:\CIC anyway, a folder or root of the website?
> > > > Is this code running on CIC?
> > > > If you visithttp://cic/targeted/results.aspwithabrowser does it work?
> > > > Do you have ASP debugging turned on?
>
> > > > Having asked that lot, CreateMHTMLBody isn't a safe thing to using in
> ASP.
> > > > Ultimately it will use the WinINet API which is designed to be used by
> a
> > > > client. If you have many such requests running at the same time all
> sorts
> > > > of undesirable things can happen.
>
> > > > --
> > > > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > Thanks for the response, Anthony.
>
> > > Read and write access (even full access) was tested and failed. D:\CIC
> > > is the root of the site on the server. Yes, the code is running on
> > > CIC. Yes, the page works properly. I may not have had ASP debugging
> > > turned on, but will try again.- Hide quoted text -
>
> > > - Show quoted text -
>
> > Yes, debugged was enabled.
>
> When debugging is turned on ASP will only use one worker thread to handle
> requests. If your ASP code performs an action which generates another
> request into the site that request will queue waiting for you ASP code to
> complete. However your ASP code won't complete until its received a
> response from the second request. Its a deadlock. Eventually the second
> request will timeout and you'd get an error, Access denied is not what I
> would expect to be the result though.
>
> Do you have anonymous access turned on?
>
> Note having ASP code generate requests to other ASP pages running in the
> same application can also be a source of problems when used heavily. You
> can end up with deadlock even without debugging turned on.
>
> --
> Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
>
> - Show quoted text -

Makes sense. I've turned off debugging and the error continues.

I do NOT have anonymous access turned on - using Integrated Windows
authentication.

The application pool for this site is using Network Service as its
identity, and LogMon is showing errors when user 'NT AUTHORITY/NETWORK
SERVICE' attempts to hit D:\CIC (the site root.) I'm wondering if it's
a permissions issue. The web server is on a domain, so I can't find
the user exactly as it is showing in the logs. What's the proper way
to add this user when the server is on a domain?

-Nate

Re: CDO Error

am 25.10.2007 16:33:57 von Anthony Jones

"Nate" wrote in message
news:1193320324.934304.87620@k79g2000hse.googlegroups.com...
> On Oct 25, 3:42 am, "Anthony Jones" wrote:
> > "Nate" wrote in message
> >
> > news:1193269925.442284.128000@e9g2000prf.googlegroups.com...
> >
> >
> >
> >
> >
> > > On Oct 24, 6:48 pm, Nate wrote:
> > > > On Oct 24, 4:32 pm, "Anthony Jones" wrote:
> >
> > > > > "Nate" wrote in message
> >
> > > > >news:1193259624.787522.15940@q3g2000prf.googlegroups.com...
> >
> > > > > > I have the following ASP code on a simple "experimental" page:
> >
> > > > > > <%
> > > > > > Set myMail=CreateObject("CDO.Message")
> > > > > > myMail.Subject="Sending email with CDO"
> > > > > > myMail.From="f...@blah.com"
> > > > > > myMail.To="t...@blah.com"
> > > > > > myMail.CreateMHTMLBody "http://cic/targeted/results.asp"
> > > > > >
mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > > > > configuration/sendusing")=2
> > > > > >
mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > > > > configuration/smtpserver")="172.30.8.51"
> > > > > >
mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> > > > > > configuration/smtpserverport")=25
> > > > > > mymail.configuration.fields.update
> > > > > > myMail.Send
> > > > > > set myMail=nothing
> > > > > > %>
> >
> > > > > > When attempting to hit this page, I receive:
> >
> > > > > > CDO.Message.1 error '80070005'
> >
> > > > > > Access is denied.
> >
> > > > > > /experiments/emailtest.asp, line 6
> >
> > > > > > I ran LogMon, and found the following error whenever I hit the
page:
> > > > > > 4:49:37 PM w3wp.exe:2992 OPEN D:\CIC ACCESS DENIED
NT
> > > > > > AUTHORITY
> > > > > > \NETWORK SERVICE
> >
> > > > > > I've tried adding the network service user to D:\CIC, but the
same
> > > > > > error persists.
> >
> > > > > Did you grant read/write access?
> > > > > What is D:\CIC anyway, a folder or root of the website?
> > > > > Is this code running on CIC?
> > > > > If you visithttp://cic/targeted/results.aspwithabrowser does it
work?
> > > > > Do you have ASP debugging turned on?
> >
> > > > > Having asked that lot, CreateMHTMLBody isn't a safe thing to using
in
> > ASP.
> > > > > Ultimately it will use the WinINet API which is designed to be
used by
> > a
> > > > > client. If you have many such requests running at the same time
all
> > sorts
> > > > > of undesirable things can happen.
> >
> > > > > --
> > > > > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
> >
> > > > > - Show quoted text -
> >
> > > > Thanks for the response, Anthony.
> >
> > > > Read and write access (even full access) was tested and failed.
D:\CIC
> > > > is the root of the site on the server. Yes, the code is running on
> > > > CIC. Yes, the page works properly. I may not have had ASP debugging
> > > > turned on, but will try again.- Hide quoted text -
> >
> > > > - Show quoted text -
> >
> > > Yes, debugged was enabled.
> >
> > When debugging is turned on ASP will only use one worker thread to
handle
> > requests. If your ASP code performs an action which generates another
> > request into the site that request will queue waiting for you ASP code
to
> > complete. However your ASP code won't complete until its received a
> > response from the second request. Its a deadlock. Eventually the
second
> > request will timeout and you'd get an error, Access denied is not what
I
> > would expect to be the result though.
> >
> > Do you have anonymous access turned on?
> >
> > Note having ASP code generate requests to other ASP pages running in the
> > same application can also be a source of problems when used heavily.
You
> > can end up with deadlock even without debugging turned on.
> >
> > --
> > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
> >
> > - Show quoted text -
>
> Makes sense. I've turned off debugging and the error continues.
>
> I do NOT have anonymous access turned on - using Integrated Windows
> authentication.
>
> The application pool for this site is using Network Service as its
> identity, and LogMon is showing errors when user 'NT AUTHORITY/NETWORK
> SERVICE' attempts to hit D:\CIC (the site root.) I'm wondering if it's
> a permissions issue. The web server is on a domain, so I can't find
> the user exactly as it is showing in the logs. What's the proper way
> to add this user when the server is on a domain?
>


On the security tab for the Cic folder click add... The default location
where object names are drawn from is the domain that the server belongs to.
However NETWORK SERVICE is local account. Therefore click Locations... and
select the computer name, click OK. Now enter NETWORK SERVICE and click OK.
Assign read access rights to this account (should be done be default).

Let me re-iterate that this is not a recommendation. You will probably get
away with it in light use and with reasonably frequent re-cycles. However
as soon as the site starts to misbehave (whether this is the cause or not)
it can be a distraction. You may find yourself under a lot of pressure to
fix it quickly because its now out in live use.


--
Anthony Jones - MVP ASP/ASP.NET

Re: CDO Error

am 25.10.2007 18:56:18 von Nate

On Oct 25, 9:33 am, "Anthony Jones" wrote:
> "Nate" wrote in message
>
> news:1193320324.934304.87620@k79g2000hse.googlegroups.com...
>
>
>
> > On Oct 25, 3:42 am, "Anthony Jones" wrote:
> > > "Nate" wrote in message
>
> > >news:1193269925.442284.128000@e9g2000prf.googlegroups.com.. .
>
> > > > On Oct 24, 6:48 pm, Nate wrote:
> > > > > On Oct 24, 4:32 pm, "Anthony Jones" wrote:
>
> > > > > > "Nate" wrote in message
>
> > > > > >news:1193259624.787522.15940@q3g2000prf.googlegroups.com...
>
> > > > > > > I have the following ASP code on a simple "experimental" page:
>
> > > > > > > <%
> > > > > > > Set myMail=CreateObject("CDO.Message")
> > > > > > > myMail.Subject="Sending email with CDO"
> > > > > > > myMail.From="f...@blah.com"
> > > > > > > myMail.To="t...@blah.com"
> > > > > > > myMail.CreateMHTMLBody "http://cic/targeted/results.asp"
>
> mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/> > > > > > configuration/sendusing")=2
>
> mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/> > > > > > configuration/smtpserver")="172.30.8.51"
>
> mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
>
>
>
>
>
> > > > > > > configuration/smtpserverport")=25
> > > > > > > mymail.configuration.fields.update
> > > > > > > myMail.Send
> > > > > > > set myMail=nothing
> > > > > > > %>
>
> > > > > > > When attempting to hit this page, I receive:
>
> > > > > > > CDO.Message.1 error '80070005'
>
> > > > > > > Access is denied.
>
> > > > > > > /experiments/emailtest.asp, line 6
>
> > > > > > > I ran LogMon, and found the following error whenever I hit the
> page:
> > > > > > > 4:49:37 PM w3wp.exe:2992 OPEN D:\CIC ACCESS DENIED
> NT
> > > > > > > AUTHORITY
> > > > > > > \NETWORK SERVICE
>
> > > > > > > I've tried adding the network service user to D:\CIC, but the
> same
> > > > > > > error persists.
>
> > > > > > Did you grant read/write access?
> > > > > > What is D:\CIC anyway, a folder or root of the website?
> > > > > > Is this code running on CIC?
> > > > > > If you visithttp://cic/targeted/results.aspwithabrowserdoes it
> work?
> > > > > > Do you have ASP debugging turned on?
>
> > > > > > Having asked that lot, CreateMHTMLBody isn't a safe thing to using
> in
> > > ASP.
> > > > > > Ultimately it will use the WinINet API which is designed to be
> used by
> > > a
> > > > > > client. If you have many such requests running at the same time
> all
> > > sorts
> > > > > > of undesirable things can happen.
>
> > > > > > --
> > > > > > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
>
> > > > > > - Show quoted text -
>
> > > > > Thanks for the response, Anthony.
>
> > > > > Read and write access (even full access) was tested and failed.
> D:\CIC
> > > > > is the root of the site on the server. Yes, the code is running on
> > > > > CIC. Yes, the page works properly. I may not have had ASP debugging
> > > > > turned on, but will try again.- Hide quoted text -
>
> > > > > - Show quoted text -
>
> > > > Yes, debugged was enabled.
>
> > > When debugging is turned on ASP will only use one worker thread to
> handle
> > > requests. If your ASP code performs an action which generates another
> > > request into the site that request will queue waiting for you ASP code
> to
> > > complete. However your ASP code won't complete until its received a
> > > response from the second request. Its a deadlock. Eventually the
> second
> > > request will timeout and you'd get an error, Access denied is not what
> I
> > > would expect to be the result though.
>
> > > Do you have anonymous access turned on?
>
> > > Note having ASP code generate requests to other ASP pages running in the
> > > same application can also be a source of problems when used heavily.
> You
> > > can end up with deadlock even without debugging turned on.
>
> > > --
> > > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
>
> > > - Show quoted text -
>
> > Makes sense. I've turned off debugging and the error continues.
>
> > I do NOT have anonymous access turned on - using Integrated Windows
> > authentication.
>
> > The application pool for this site is using Network Service as its
> > identity, and LogMon is showing errors when user 'NT AUTHORITY/NETWORK
> > SERVICE' attempts to hit D:\CIC (the site root.) I'm wondering if it's
> > a permissions issue. The web server is on a domain, so I can't find
> > the user exactly as it is showing in the logs. What's the proper way
> > to add this user when the server is on a domain?
>
> On the security tab for the Cic folder click add... The default location
> where object names are drawn from is the domain that the server belongs to.
> However NETWORK SERVICE is local account. Therefore click Locations... and
> select the computer name, click OK. Now enter NETWORK SERVICE and click OK.
> Assign read access rights to this account (should be done be default).
>
> Let me re-iterate that this is not a recommendation. You will probably get
> away with it in light use and with reasonably frequent re-cycles. However
> as soon as the site starts to misbehave (whether this is the cause or not)
> it can be a distraction. You may find yourself under a lot of pressure to
> fix it quickly because its now out in live use.
>
> --
> Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Even with NETWORK SERVICE being added, it throws a denied error.

I understand that this is not a recommendation. The overall goal of
this is to mail the contents of an ASP page (results.asp) on a daily
basis. What alternative would you recommend?

Re: CDO Error

am 25.10.2007 21:26:00 von Anthony Jones

"Nate" wrote in message
news:1193331378.197349.137510@19g2000hsx.googlegroups.com...
> On Oct 25, 9:33 am, "Anthony Jones" wrote:
> > "Nate" wrote in message
> >
> > news:1193320324.934304.87620@k79g2000hse.googlegroups.com...
> >
> >
> >
> > > On Oct 25, 3:42 am, "Anthony Jones" wrote:
> > > > "Nate" wrote in message
> >
> > > >news:1193269925.442284.128000@e9g2000prf.googlegroups.com.. .
> >
> > > > > On Oct 24, 6:48 pm, Nate wrote:
> > > > > > On Oct 24, 4:32 pm, "Anthony Jones"
wrote:
> >
> > > > > > > "Nate" wrote in message
> >
> > > > > > >news:1193259624.787522.15940@q3g2000prf.googlegroups.com...
> >
> > > > > > > > I have the following ASP code on a simple "experimental"
page:
> >
> > > > > > > > <%
> > > > > > > > Set myMail=CreateObject("CDO.Message")
> > > > > > > > myMail.Subject="Sending email with CDO"
> > > > > > > > myMail.From="f...@blah.com"
> > > > > > > > myMail.To="t...@blah.com"
> > > > > > > > myMail.CreateMHTMLBody "http://cic/targeted/results.asp"
> >
> > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/> > >
> > > configuration/sendusing")=2
> >
> > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/> > >
> > > configuration/smtpserver")="172.30.8.51"
> >
> > mymail.configuration.fields.item("http://schemas.microsoft.c om/cdo/
> >
> >
> >
> >
> >
> > > > > > > > configuration/smtpserverport")=25
> > > > > > > > mymail.configuration.fields.update
> > > > > > > > myMail.Send
> > > > > > > > set myMail=nothing
> > > > > > > > %>
> >
> > > > > > > > When attempting to hit this page, I receive:
> >
> > > > > > > > CDO.Message.1 error '80070005'
> >
> > > > > > > > Access is denied.
> >
> > > > > > > > /experiments/emailtest.asp, line 6
> >
> > > > > > > > I ran LogMon, and found the following error whenever I hit
the
> > page:
> > > > > > > > 4:49:37 PM w3wp.exe:2992 OPEN D:\CIC ACCESS
DENIED
> > NT
> > > > > > > > AUTHORITY
> > > > > > > > \NETWORK SERVICE
> >
> > > > > > > > I've tried adding the network service user to D:\CIC, but
the
> > same
> > > > > > > > error persists.
> >
> > > > > > > Did you grant read/write access?
> > > > > > > What is D:\CIC anyway, a folder or root of the website?
> > > > > > > Is this code running on CIC?
> > > > > > > If you visithttp://cic/targeted/results.aspwithabrowserdoes it
> > work?
> > > > > > > Do you have ASP debugging turned on?
> >
> > > > > > > Having asked that lot, CreateMHTMLBody isn't a safe thing to
using
> > in
> > > > ASP.
> > > > > > > Ultimately it will use the WinINet API which is designed to be
> > used by
> > > > a
> > > > > > > client. If you have many such requests running at the same
time
> > all
> > > > sorts
> > > > > > > of undesirable things can happen.
> >
> > > > > > > --
> > > > > > > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
> >
> > > > > > > - Show quoted text -
> >
> > > > > > Thanks for the response, Anthony.
> >
> > > > > > Read and write access (even full access) was tested and failed.
> > D:\CIC
> > > > > > is the root of the site on the server. Yes, the code is running
on
> > > > > > CIC. Yes, the page works properly. I may not have had ASP
debugging
> > > > > > turned on, but will try again.- Hide quoted text -
> >
> > > > > > - Show quoted text -
> >
> > > > > Yes, debugged was enabled.
> >
> > > > When debugging is turned on ASP will only use one worker thread to
> > handle
> > > > requests. If your ASP code performs an action which generates
another
> > > > request into the site that request will queue waiting for you ASP
code
> > to
> > > > complete. However your ASP code won't complete until its received a
> > > > response from the second request. Its a deadlock. Eventually the
> > second
> > > > request will timeout and you'd get an error, Access denied is not
what
> > I
> > > > would expect to be the result though.
> >
> > > > Do you have anonymous access turned on?
> >
> > > > Note having ASP code generate requests to other ASP pages running in
the
> > > > same application can also be a source of problems when used heavily.
> > You
> > > > can end up with deadlock even without debugging turned on.
> >
> > > > --
> > > > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
> >
> > > > - Show quoted text -
> >
> > > Makes sense. I've turned off debugging and the error continues.
> >
> > > I do NOT have anonymous access turned on - using Integrated Windows
> > > authentication.
> >
> > > The application pool for this site is using Network Service as its
> > > identity, and LogMon is showing errors when user 'NT AUTHORITY/NETWORK
> > > SERVICE' attempts to hit D:\CIC (the site root.) I'm wondering if it's
> > > a permissions issue. The web server is on a domain, so I can't find
> > > the user exactly as it is showing in the logs. What's the proper way
> > > to add this user when the server is on a domain?
> >
> > On the security tab for the Cic folder click add... The default location
> > where object names are drawn from is the domain that the server belongs
to.
> > However NETWORK SERVICE is local account. Therefore click Locations...
and
> > select the computer name, click OK. Now enter NETWORK SERVICE and click
OK.
> > Assign read access rights to this account (should be done be default).
> >
> > Let me re-iterate that this is not a recommendation. You will probably
get
> > away with it in light use and with reasonably frequent re-cycles.
However
> > as soon as the site starts to misbehave (whether this is the cause or
not)
> > it can be a distraction. You may find yourself under a lot of pressure
to
> > fix it quickly because its now out in live use.
> >
> > --
> > Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
> >
> > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -
>
> Even with NETWORK SERVICE being added, it throws a denied error.
>
> I understand that this is not a recommendation. The overall goal of
> this is to mail the contents of an ASP page (results.asp) on a daily
> basis. What alternative would you recommend?
>

Sadly none of the alternatives are as elegant and what alternative you use
really depends on how results.asp is currently constructed.

The simplest option is:-

Place results.asp in a separate application and allow anonymous access. It
would mean that all replaced elements such as images etc would also need to
be present in the application. You could restrict access by IP address or by
using a random host name.

Other way more ugly are:-

Use an include ASP to generate XML for the dynamic part of resutls asp and
an XSL that transfors the result to the orignal output of results.asp.
Results.asp could use the include and the XSL to send output to response
whereas you email.asp could use them to create a string to assign to the
HTMLBody. Handling replaced elements such as imgs could be tricky though.
The CreateMHTMLBody would automatically build these into the message as
related parts which bloats the email but gives a much better chance that the
recipient will see it as intended. One way round this is to include a BASE
element in the html and simple ensure the references to images are available
public. Generates a smaller email but could increase the load on your
server and would likely be initially blocked by the receiver.

Another alternative similar to the above is to have an include containing
code similar to the results.asp but all static HTML is written by code
inside <% %>. In stead of writing to Response it would write to an abstract
output object. This is either set to response or a wrapper class that
contains an ADODB.Stream object. The wrapper class would have a write
method that delegates to the streams WriteText method. In results.asp the
output variable is set to Response but in email.asp the output variable is
set to the wrapper class where its internal stream object is set to the
..HTMLBodyPart.GetDecodedStream. Again this will not automatically build in
the related parts.

Personally I use a variation of the the XML based one where replaced
elements in the html are included as related parts built 'manually' by the
code. Very ugly but effective.

--
Anthony Jones - MVP ASP/ASP.NET