PRB: Permission Denied While Using CDONTS to Send Mail with Exchange

ID: Q228465


The information in this article applies to:


SYMPTOMS

When attempting to send e-mail from an Active Server Pages (ASP) page that uses the CDONTS.NEWMAIL object (out of process), you receive the following error message:

Permission Denied
This error occurs on machines with the following configuration:


CAUSE

This problem occurs when you select the Upgrade Only option while installing Windows NT Server Option Pack 4.


RESOLUTION

Adding "IUSR_Machinename" to the admin group resolves the error, but you need to remove the IUSR_Machinename from the admin group for security reasons. In addition, check the IUSR account, and make sure it still has access to all exchange folders and the Metabase.bin file (since you are running CDONTS out of process).

Verify the following settings in the registry:

  1. Verify that the Exchange IMS is installed and functioning.


  2. Verify that HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\Active Messaging\Use Exchange exists and is set to 1.


  3. Verify that HKEY_LOCAL_MACHINE\SYSTEM\CCS\Services\MSExchangeIMC\Parameters\RootDir exists and verify that the path exists. Append \pickup to the RootDir value and make sure that directory exists, too.


  4. Change the access for the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\Active Messaging key to allow full control to all.


  5. Change the access for the HKEY_LOCAL_MACHINE\SYSTEM\CCS\Services\MSExchangeIMC\Parameters key to allow full control to all.


  6. Let Dir be the directory specified in HKEY_LOCAL_MACHINE\SYSTEM\CCS\Services\MSExchangeIMC\Parameters\RootDir. Make sure Dir and its subdirectories allows change access to all.


After following these steps, the same error appears.

When the Windows NT Server Option Pack is installed, select the Upgrade Plus option during setup instead of Upgrade Only option. This option installs the SMTP Service, among others, that is needed for CDONTS for work properly.

Use these steps for another resolution:
  1. Remove "Exchange Internet Mail Connector" via the Exchange Admin.


  2. Install the Option Pack SMTP Service.


  3. Re-install and configure the "Exchange Intenet Mail Connector." NOTE: This will disable the SMTP Service)



STATUS

This behavior is by design. In order for CDONTS to work properly the SMTP service must be installed.


MORE INFORMATION

Steps to Reproduce Behavior

Use a machine with the following configuration.
Copy and pass the following code in an ASP file. Change the e-mail address to your e-mail address.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>CDONTS test email asp (out of process ).</title>
</head>

<body>
<%

Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "PutYourEmailAddressHere"
objMail.To = "PutYourEmailAddressHere"
objMail.Subject="Test Email"
objMail.Body = "Test Email"
objMail.Send
Set objMail = nothing
%>

<p><strong>Your mail has been sent. </strong></p>

</body>
</html><BR/>
Try to run the asp and all the steps above and you will receive the permission denied error. 

Additional query words:


Keywords          : kbCDONTS 
Version           : WINDOWS:1.2
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: June 11, 1999