Microsoft KB Archive/286301

= Run-time error 800a0046 with CDONTS.Newmail object =

Article ID: 286301

Article Last Modified on 10/17/2006

-

APPLIES TO


 * Microsoft Collaboration Data Objects 1.2 for NT Server
 * Microsoft Windows NT 4.0
 * Microsoft Windows 2000 Standard Edition

-



This article was previously published under Q286301



SYMPTOMS
When you try to send mail by using the CDONTS.NewMail object in Active Server Pages (ASP), you may receive the following error message, where xxx is the line number that uses the Send method of the NewMail object:

Microsoft VBScript runtime error '800a0046'

Permission denied

/filename.asp, line xxx



CAUSE
This error occurs because the ASP page runs in its own memory space through Internet Information Services (IIS). To see if this is the case, follow these steps in IIS 4.0:
 * 1) Open the Microsoft Management Console (MMC) for IIS 4.0.
 * 2) Right-click the root folder or virtual folder in which your page resides.
 * 3) Click Properties.
 * 4) Click the Home Directory or the Virtual Directory tab.
 * 5) Verify that Run in separate memory space is selected.

In IIS 5.0, you can see that High (isolated) is selected in the Application Protection list.



RESOLUTION
To resolve this issue, Microsoft recommends that you run the page in-process. To run the page in-process, click to clear the Run in separate memory space check box in IIS 4.0. Follow the steps in the &quot;Steps to Reproduce the Behavior&quot; section of this article, but in Step 5, click to clear the check box in IIS 4.0.

In IIS 5.0, a workaround that Microsoft does not support or recommend is to add the IWAM_Machinename account to the Operators tab for the SMTP service. This gives the IWAM_Machinename account the correct permissions to the metabase that CDO for NTS (CDONTS) requires.

Note This workaround gives all out-of-process applications access to the metabase, and Microsoft does not recommend this method.



STATUS
CDONTS was designed to be run as an in-process component through IIS. Typically, the IUSR_Machinename account is given access to the metabase. This account is used by applications that run in-process with IIS. When you run an application out-of-process, it runs from MTS under the IWAM_Machinename account. By default, this account is not given the necessary permissions to the metabase.

This behavior is by design.



Steps to Reproduce the Behavior

 * 1) Create an ASP page that uses CDONTS to send mail.
 * 2) Open the Microsoft Management Console (MMC) for IIS 4.0.
 * 3) Right-click the root folder or virtual folder in which your page resides.
 * 4) Click Properties.
 * 5) Click the Home Directory or the Virtual Directory tab.
 * 6) Verify that the Run in separate memory space check box is checked.
 * 7) Run the page.

