Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CDO.Message.1 error '80070005' Access is denied.

I am getting this error when I try to send via the local server

CDO.Message.1 error '80070005' 

Access is denied. 

/mail.asp, line xxx 

Here is the code I am using

  MailBodyText = "TEST"

  Set objNewMail = CreateObject("CDO.Message")
  objNewMail.To =  sSendTo
  objNewMail.From = "[email protected]"
  objNewMail.Cc = "[email protected]"
  objNewMail.Subject =  "Information Request & Feedback"
  objNewMail.HTMLBody = "The following information was sent from " & sEmail & ":" & "<br>" & CHR(13) & MailBodyText & "<br>copies of this mail we sent to :"& sSendTo
  objNewMail.Send

  Set objNewMail = Nothing 

It looks like it is a permission error at the ISSUR doesn't have write permission to write to the mailroot/pickup folder.

But we have checked that and the services account that this site is using seems to have the rights.

Question is this error always a file permission error?

Question how to know / set the location that CDO is using? So we can confirm the permissions

What else should look at to fix this?

like image 371
Pbearne Avatar asked Jun 07 '10 12:06

Pbearne


1 Answers

Use the .configuration property which allows for authentication and other fine tuning..

examples at : http://www.paulsadowski.com/wsh/cdo.htm

update

The .configuration property allows to set the pickup directory (as you request)

objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
objNewMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
objNewMail.Configuration.Fields.Update
objNewMail.Send
like image 130
Gabriele Petrioli Avatar answered Sep 21 '22 10:09

Gabriele Petrioli