Run-time error 800a0046 with CDONTS.Newmail object (286301)



The information in this article applies to:

  • Collaboration Data Objects (CDO) for NTS 1.2
  • the operating system: Microsoft Windows NT 4.0
  • the operating system: Microsoft Windows 2000

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 "Steps to Reproduce the Behavior" 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.

MORE INFORMATION

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.

REFERENCES

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

197619 Runtime error '800a0046' using the send method of CDONTS.NewMail


Modification Type:MajorLast Reviewed:10/17/2006
Keywords:kbprb KB286301 kbAudDeveloper