Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Permission denied error and "CDONTS.NewMail"

Status
Not open for further replies.
Oct 2, 2002
104
US
I have a series of ASP pages that my company uses to allow technicians to send us status on service calls over the web.

This application has worked fine for over a year, but recently, something happened with permissions on the windows2000/exchange 2000 server from which our website is hosted.

On clicking "submit" I get the following error:
Microsoft VBScript runtime error '800a0046'
Permission denied
/forms/process_call.asp, line 143

Seems to be caused on the endif of the code snippet below:

if mailto <> "" then
Set Mail=Server.CreateObject("CDONTS.NewMail")
Mail.To=mailto
Mail.CC = copyto
Mail.From="website@smartech-csi.com"
Mail.Subject=mailtosubject
Mail.Body=messagebody
mail.send
end if

In researching the problem, it seems as if CDONTS is what the problem is.

Set Mail=Server.CreateObject("CDONTS.NewMail")

I think this object creation is what's triggering the problem: the proper access to the directory needed to create, and then relay the smtp message. I'm not sure what directory this would be - if you know where it is/may be, please let me know.


Also, if there is a way to set IIS permissions/access back to defaults, I could do that as well.
 
Hey,
I tried that first thing, no dice.

I should mention I also have Exchange 2000 installed... maybe smtp mail will be handled elsewhere?
 
Hi,


Anyone made in roads on this, I have exact same problem on a Win 2003 IIS 6 machine. The same code is working on an exact replica machine and code on 2 other servers but has doesnt send out EMAILS from CDONTS on one of the machines.

I have tried the MS Article, and the folders in question even the inetpub\mailRoot\PickUp folder has rights to write. The permissions are all up to standard. The SMTP is turned on. I have the CDONTS AND CDO .dlls on the machine.

I am stumped. It fails on the sending of the email .
 
I solved a similar problem this way, don't know if it will help you.

Code:
	Set objMessage = CreateObject("CDO.Message") 
	objMessage.Subject = "Subject" 
	objMessage.Sender = "Address@Domain.com"
	objMessage.From = "Address@Domain.com"
	objMessage.To = "Address@Domain.com"
	objMessage.TextBody = "Message"

	objMessage.Configuration.Fields.Item _ 
	("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2 

 
	objMessage.Configuration.Fields.Item _ 
	("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "SMTPServerName" 

 
	objMessage.Configuration.Fields.Item _ 
	("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25 

	objMessage.Configuration.Fields.Update 


	objMessage.Send
 
If you have SMTP turned on on your web server you can use the name of your web server, that should work.

These are actually local address so the address wont change

see for more information

so what this is effectivly doing is going out looking for smtp server "servername" finding the smtp server and sending it out on that using port defined.

Its certainly not ideal but its the only way I found of solving a similar problem to the one you are describing
 
Solved it guys .


It is the Permissions . I dont understand it. If I put the IUSR_MACHINENAME into the ADMIN Group . The email works, if I leave him with Read+Write , it doesnt. I dont want to do this though as it is bad having IURS_MACHINENAME haveing ADMIN RIGHTS .....

Which folder does it need ADMIN rights to, I have tried all individually and IT FAILS.
 
I'm still lost on this one.
Ye Old Internet has lots of advice, none of it seems to work very well.

Anybody have a magic bullet?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top