Reputation: 153
I'm making changes to a website written in classic asp.
My system is a Windows 7 64-bit.
I've been able to get the website to run, after setting it up as a classic asp running on IIS6.
When it attempts to execute the following code, I get the permission denied error:
from1 = "[email protected]"
to1 = "[email protected]"
to2 = "[email protected]"
to3 = "[email protected]"
strTo = to1
If Len(strTo) > 0 Then
If Len(to2) > 0 Then
strTo = strTo & ";" & to2
End If
Else
strTo = to2
End If
If Len(strTo) > 0 Then
If Len(to3) > 0 Then
strTo = strTo & ";" & to3
End If
Else
strTo = to3
End If
body = reqApprName & "<br />" & reqApprPhone & "<br />" & reqApprEmail & "<br />Loan Number: "_
& loannum & "<br /><br />Please do not reply back to this email. The Vendor has provided the following "_
& "comment associated with this order.<br /><br />" & reqUndueInfluenceComment
Set ObjMail = CreateObject("CDONTS.Newmail")
ObjMail.From = from1
ObjMail.To = strTo
ObjMail.Subject = "Appraisal Order "&OrderNum&" by Vendor"
ObjMail.BodyFormat = 0
ObjMail.MailFormat = 0
ObjMail.Body = body
ObjMail.Send
Set ObjMail = Nothing
I'm puzzled, since I've never had a problem with CDONTS before. Then again, I've never tried using it on a Windows 7 64 bit machine, using 32 bit classic asp.
Does anyone have any ideas?
Thanks, all.
PS: I get the error on the create object for CDONTS.NewMail
Upvotes: 2
Views: 23569
Reputation: 915
When you try to send a message, you may receive the following error message:
Microsoft VBScript runtime error '800a0046' Permission denied
This problem occurs when an application is run out-of-process in IIS.
When this problem occurs, the user context of the process changes from the IUSR_MachineName account that does have access to the IIS metabase to the IWAM_MachineName account that does not have access to the IIS metabase.
Typically, this error has two causes.
The user under whom the .asp page is running or the script is running does not have permissions to the Pickup directory.
Typically, the Pickup directory is found in the following locations:
For computers that are running IIS only: C:\Inetpub\Mailroot\Pickup
For computers that are running Microsoft Exchange 5.5: Exchsrvr\Mailroot\Pickup
For computers that are running Exchange 2000: \Program files\Exchsrvr\Mailroot\Vsi #\Pickup
Solution
The user under whom the .asp page is running or the script is running must have Modify (Change) permission to the Pickup directory so that the NewMail object can create the .eml file.
The page is running in its own memory space and is being denied access to the IIS metabase. To verify this, follow these steps:
Click Start, click Run, type Inetmgr, and then click OK.
Right-click either the root directory or the virtual directory that contains your page, and then click Properties.
If you right-clicked the root directory in step 2, click the Home Directory tab.
If you right-clicked the virtual directory in step 2, click the Virtual Directory tab.
On a computer that is running Windows NT, determine whether the Run in separate memory space check box is checked.
If the Run in separate memory space check box is checked, click to clear the check box. Alternatively, on the Properties menu of the SMTP service, click the Operators tab, and then add the IWAM_MachineName account.
On a computer that is running Windows 2000, determine whether the Application Protection setting is set to High (Isolated). If the Application Protection setting is set to High (Isolated), set the Application Protection setting to Medium (Pooled). Alternatively, on the Properties menu of the SMTP service, click the Security tab, and then add the IWAM_MachineName account to the Operators account.
Upvotes: 4