Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft VBScript runtime error '800a0046' CDONTS

Status
Not open for further replies.

cherisc

ISP
Dec 9, 2004
71
US
I am a network tech, not a programmer.

I have a customer running the following code on our Windows 2000 IIS 5.0 server and when I try to directly open the page using IE6, I get the error:
Microsoft VBScript runtime error '800a0046'

Permission denied

/xxxxx_xxxxxxxx/xxxxxxxxx.asp, line 159

I belive it is a permissions error, but I don't know where.
Any Ideas??
<%
strHTML = "<html><head><title>Customer Order</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>" & _
"</head><body bgcolor='#FFFFFF' text='#000000' marginwidth='0' marginheight='0' topmargin='0' leftmargin='0'>" & _
"<table width='450' border='0' cellspacing='2' cellpadding='2' bgcolor='#FFFFFF'>" & _
"<tr bgcolor='#FF0000'><td colspan='2'><div align='center'><b><font face='Arial, Helvetica, sans-serif' size='3'>Customer Color Selector Order</font></b></div></td>" & _
"</tr><tr bgcolor='#000000'><td width='150'><div align='center'><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Sections &amp; Color</font></b></div>" & _
"</td><td><div align='center'><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Item Style: " & Request("style") & "</font></b></div>" & _
"</td></tr><tr><td width='175' valign='top'><font face='Arial, Helvetica, sans-serif' size='2'>"
if Request("c1Color") <> "" Then
strHTML = strHTML & "Collar 1: " & Request("c1Color") & "<br>"
end if

if Request("c2Color") <> "" Then
strHTML = strHTML & "Collar 2: " & Request("c2Color") & "<br>"
end if

if Request("c3Color") <> "" Then
strHTML = strHTML & "Collar 3: " & Request("c3Color") & "<br>"
end if

if Request("yColor") <> "" Then
strHTML = strHTML & "Yoke: " & Request("yColor") & "<br>"
end if

if Request("ysColor") <> "" Then
strHTML = strHTML & "Yoke Stripe: " & Request("ysColor") & "<br>"
end if

if Request("slColor") <> "" Then
strHTML = strHTML & "Sleeves: " & Request("slColor") & "<br>"
end if

if Request("cfColor") <> "" Then
strHTML = strHTML & "Cuff: " & Request("cfColor") & "<br>"
end if



if Request("gColor") <> "" Then
strHTML = strHTML & "Graphic: " & Request("gColor") & "<br>"
end if

if Request("hColor") <> "" Then
strHTML = strHTML & "Hem: " & Request("hColor") & "<br>"
end if

if Request("hyColor") <> "" Then
strHTML = strHTML & "Hem &amp; Yoke: " & Request("hyColor") & "<br>"
end if

if Request("sdColor") <> "" Then
strHTML = strHTML & "Sides: " & Request("sdColor") & "<br>"
end if

if Request("s1Color") <> "" Then
strHTML = strHTML & "Stripe 1: " & Request("s1Color") & "<br>"
end if

if Request("s2Color") <> "" Then
strHTML = strHTML & "Stripe 2: " & Request("s2Color") & "<br>"
end if

if Request("s3Color") <> "" Then
strHTML = strHTML & "Stripe 3: " & Request("s3Color") & "<br>"
end if

if Request("bColor") <> "" Then
strHTML = strHTML & "Body: " & Request("bColor")
end if


strHTML = strHTML & "</font></td><td width='275'> " & _
" <div align='center'><font face='Arial, Helvetica, sans-serif' size='2'><img src=' & request("productPic") & "' align='middle'></font></div>" & _
"</td>" & _
"</tr>" & _
"<tr> " & _
"<td colspan='2'> " & _
" <table width='440' border='0' cellspacing='2' cellpadding='2' align='center'>" & _
" <tr bgcolor='#FF0000'> " & _
" <td colspan='2'> " & _
" <div align='center'><font face='Arial, Helvetica, sans-serif' size='3'><b>Customer " & _
" Information:</b></font></div>" & _
" </td>" & _
"</tr>" & _
"<tr> " & _
"<td width='75' bgcolor='#000000'> " & _
" <p><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Name: </font></b></p>" & _
"</td>" & _
" <td width='365'><font face='Arial, Helvetica, sans-serif' size='2'>" & Request("Name") & "</font></td>" & _
"</tr>" & _
"<tr> " & _
" <td width='75' bgcolor='#000000'><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Address: </font></b></td>" & _
" <td width='365'><font face='Arial, Helvetica, sans-serif' size='2'>" & Request("Address") & "</font></td>" & _
"</tr>" & _
"<tr> " & _
"<td width='75' bgcolor='#000000'><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>City: </font></b></td>" & _
" <td width='365'><font face='Arial, Helvetica, sans-serif' size='2'>" & Request("City") & "</font></td>" & _
"</tr>" & _
"<tr> " & _
"<td width='75' bgcolor='#000000'><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>State: </font></b></td>" & _
"<td width='365'><font face='Arial, Helvetica, sans-serif' size='2'>" & Request("State") & "</font></td>" & _
"</tr>" & _
"<tr> " & _
" <td width='75' bgcolor='#000000'><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Zip Code: </font></b></td>" & _
" <td width='365'><font face='Arial, Helvetica, sans-serif' size='2'>" & Request("Zip") & "</font></td>" & _
"</tr>" & _
"<tr> " & _
"<td width='75' bgcolor='#000000'><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Phone: </font></b></td>" & _
" <td width='365'><font face='Arial, Helvetica, sans-serif' size='2'>" & Request("Phone") & "</font></td>" & _
"</tr>" & _
"<tr> " & _
"<td width='75' bgcolor='#000000'><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Email: </font></b></td>" & _
" <td width='365'><font face='Arial, Helvetica, sans-serif' size='2'>" & Request("Email") & "</font></td>" & _
"</tr>" & _
"<tr> " & _
"<td width='75' bgcolor='#000000'> " & _
"<p><b><font face='Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>PO #: </font></b></p>" & _
"</td>" & _
"<td width='365'><font face='Arial, Helvetica, sans-serif' size='2'>" & Request("PO") & "</font></td>" & _
"</tr>" & _

"</table>" & _
"</td>" & _
"</tr>" & _
"</table>" & _
"</body>" & _
"</html>"

Dim objEmail
set objEmail = server.CreateObject("CDONTS.NewMail")
with objEmail
' .To = "XXXXXXX@aol.com"
.To = "xxxxx@x1xxxxxx.com"
.From = "xxxxx@x1xxxxxx.com"
.Importance = 1
.Subject = "Customer Web Site Order"


''.Body = '<HTML><BODY>Name: ' & Request('Name') & '<BR> Stripe 2 Color:' & Request('s2Color') & '<br><br></body></html>'
.Body = strHTML
.BodyFormat = 0
.MailFormat = 0
.Send
end with
set objEmail = nothing

%>
 
make sure that the IUSR_Machine name has all the required permissions to use the CDONTS mail object...also make sure that you can use CDONTS...CDOSYS replaced CDONTS...

-DNG
 
Thank you for the quick response DotNetGnat. I already figured it is some kind of permissions problem, but I don't know which permissions CDONTS needs. Any suggestions?
 
also i found this resoultion online

Code:
To resolve this error, follow these steps: 1. Open the Windows NT Explorer and browse to your mail folders. By default, this is the X:\InetPub\MailRoot folder, where X: is the drive that you specified during the installation of NTOP. 
2. Right-click the Pickup folder, and then click Properties. 
3. On the Security tab, click Permissions. 
4. If the IIS user accounts are listed, IUSR_<computer> and IWAM_<computer> are the defaults, skip to step 13. 
5. Click Add. 
6. Select your computer in the List Names From: drop-down menu. 
7. Click Show Users. 
8. Highlight the IUSR_<computer> Internet guest account and the IWAM_<computer> impersonation account, then click Add. 
9. Click Change in the Type Of Access drop-down menu. 
10. Click OK to close the Add Users And Groups dialog. 
11. Click OK to close the Directory Permissions dialog. 
12. Click OK to close the Directory Properties dialog. 
13. Repeat steps 2 through 12 for each folder under the MailRoot folder.

-DNG
 
I already tried that article. It did not work. Got anything else?
 
On the same server, but under a different virtual directory, I tried this code:
<%
Set FS = CreateObject("Scripting.FileSystemObject")
' Get the physical folder of the current page
myPath = FS.GetParentFolderName(Request.ServerVariables("PATH_TRANSLATED"))
Set myFolder = FS.GetFolder(myPath)
' Get the drive of the physical folder
Set myDrive = myFolder.Drive
' Find out how much free space is available on that drive
FreeSpace = CInt(myDrive.FreeSpace / 1000000)
If FreeSpace < 100 Then
' Under 100 MB of diskspace is availabe
Response.Write "Only " & FreeSpace & "MB of diskspace is available."
Else
Response.Write "Success"
End If
%>
With these results:
Microsoft VBScript runtime error '800a0046'

Permission denied

/test2.asp, line 9

This leads me to believe that this is not specific to CDONTS.
 
Like DNG said, the IUSR_MachineName wont have access to much unless you grant it.
 
I have tried adding IUSR_XXXXX to the system32 folder with no luck. The IUSR_XXXXX also has access to all of the subfolders of the mailroot folder and to the directory that the web site is located in. Is there another place where I should grant permissions?
 
As a test you might want to un-check anonymous access and connect with an account that has local admin on the web server, just to see what happens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top