简体   繁体   English

Microsoft VBScript运行时错误:创建CDONTS.NEWMAIL时权限被拒绝:'CreateObject'

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

I'm making changes to a website written in classic asp. 我正在更改以经典ASP编写的网站。

My system is a Windows 7 64-bit. 我的系统是Windows 7 64位。

I've been able to get the website to run, after setting it up as a classic asp running on IIS6. 将其设置为在IIS6上运行的经典asp之后,我已经能够运行该网站。

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. 我很困惑,因为我以前从未遇到过CDONTS问题。 Then again, I've never tried using it on a Windows 7 64 bit machine, using 32 bit classic asp. 再说一次,我从未尝试过在Windows 7 64位计算机上使用32位经典ASP来使用它。

Does anyone have any ideas? 有人有什么想法吗?

Thanks, all. 谢谢大家

PS: I get the error on the create object for CDONTS.NewMail PS:我在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. 当应用程序在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. 发生此问题时,该进程的用户上下文将从无法访问IIS元数据库的IUSR_MachineName帐户更改为无法访问IIS元数据库的IWAM_MachineName帐户。

Typically, this error has two causes. 通常,此错误有两个原因。

  • Cause 1 原因1

The user under whom the .asp page is running or the script is running does not have permissions to the Pickup directory. 运行.asp页或运行脚本的用户没有对分拣目录的权限。

Typically, the Pickup directory is found in the following locations: 通常,分拣目录位于以下位置:

For computers that are running IIS only: C:\\Inetpub\\Mailroot\\Pickup 对于仅运行IIS的计算机:C:\\ Inetpub \\ Mailroot \\ Pickup

For computers that are running Microsoft Exchange 5.5: Exchsrvr\\Mailroot\\Pickup 对于运行Microsoft Exchange 5.5的计算机:Exchsrvr \\ Mailroot \\ Pickup

For computers that are running Exchange 2000: \\Program files\\Exchsrvr\\Mailroot\\Vsi #\\Pickup 对于运行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 原因2

The page is running in its own memory space and is being denied access to the IIS metabase. 该页面在其自己的内存空间中运行,并且被拒绝访问IIS元数据库。 To verify this, follow these steps: 要验证此,请按照下列步骤操作:

Click Start, click Run, type Inetmgr, and then click OK. 单击开始,单击运行,键入Inetmgr,然后单击确定。

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. 如果在步骤2中右键单击根目录,请单击“主目录”选项卡。

If you right-clicked the virtual directory in step 2, click the Virtual Directory tab. 如果在步骤2中右键单击虚拟目录,请单击“虚拟目录”选项卡。

On a computer that is running Windows NT, determine whether the Run in separate memory space check box is checked. 在运行Windows NT的计算机上,确定是否选中了“在单独的内存空间中运行”复选框。

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. 或者,在SMTP服务的“属性”菜单上,单击“操作员”选项卡,然后添加IWAM_MachineName帐户。

On a computer that is running Windows 2000, determine whether the Application Protection setting is set to High (Isolated). 在运行Windows 2000的计算机上,确定“应用程序保护”设置是否设置为“高(隔离)”。 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. 或者,在SMTP服务的“属性”菜单上,单击“安全性”选项卡,然后将IWAM_MachineName帐户添加到“操作员”帐户。

Support.Microsoft.com Support.Microsoft.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM