Microsoft VBScript runtime error: Permission denied: 'CreateObject' when creating CDONTS.NEWMAIL

StackOverflow https://stackoverflow.com/questions/23684353

質問

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 = "Kevin@company.com"

    to1 = "staff1@company.com"
    to2 = "staff2@company.net"
    to3 = "staff3@client.com"

    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

役に立ちましたか?

解決

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.

  • Cause 1

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.

  • Cause 2

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.

Support.Microsoft.com

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top