Link to home
Start Free TrialLog in
Avatar of indyng
indyng

asked on

Why is there an error?

Hi Experts,

Why am I getting this error?

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied
/intermodal/email.asp, line 56

I am using this script I found:


<%
Dim strTo, strSubject, strBody 'Strings for recipient, subject, body

Dim objCDOMail 'The CDO object


strTo = "lan.ho@chep.com"

' Both of these should be changed before you run this script.
strSubject = "Sample E-mail sent from ASP 101!"

' This is multi-lined simply for readability

strBody = "THIS IS A TEST"


' Create an instance of the NewMail object.

Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
      
' Set the properties of the object
      

objCDOMail.From    = "ricky.ng@chep.com"

objCDOMail.To      = strTo
objCDOMail.Subject = strSubject
objCDOMail.Body    = strBody

' There are lots of other properties you can use.
' You can send HTML e-mail, attachments, etc...
' You can also modify most aspects of the message
' like importance, custom headers, ...
' Check the documentation for a full list as well
' as the correct syntax.

' Some of the more useful ones I've included samples of here:
'objCDOMail.Cc         = "user@domain.com;user@domain.com"
'objCDOMail.Bcc        = "user@domain.com;user@domain.com"

objCDOMail.Importance = 1 '(0=Low, 1=Normal, 2=High)

'objCDOMail.AttachFile "c:\path\filename.txt", "filename.txt"

' I've had several requests for how to send HTML email.
' To do so simply set the body format to HTML and then
' compose your body using standard HTML tags.
'objCDOMail.BodyFormat = 0 ' CdoBodyFormatHTML
      
'Outlook gives you grief unless you also set:
'objCDOMail.MailFormat = 0 ' CdoMailFormatMime


' Send the message!
objCDOMail.Send
      
' Set the object to nothing because it immediately becomes
' invalid after calling the Send method.
Set objCDOMail = Nothing

'Response.Write "Message sent to " & strTo & "!"
Response.Write "Message was sent"

%>


Line 56 is:

objCDOMail.Send


THANKS
Avatar of kevp75
kevp75
Flag of United States of America image

this may help
http://www.aspemporium.com/support.aspx?PRB020

just by looking at your code.  It looks like you are trying to attach a file from c:\path, which may not exist.  you may want to consider either getting rid of that line (if you are not trying to attach a file to email you are sending), or put in the correct path (if you are trying to attach a file to the email)
Avatar of indyng
indyng

ASKER

kevp75,

I am not attaching any files. That line has been commented out.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of randeeps
randeeps

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
lol....sorry folks, I'm blind without my morning coffee  :)

@indyng  Definatly check out the links above

CDONTS component is not installed in the server. check with service provider about it
oh so it is already abandoned ? sori for my post then
@gawai

Collaborative Data Objects (CDO) are installed by default with the installation of windows:
CDONTS for windows 2000, and CDOSYS for windows 2003
randpeeps has the correct answer
actually, cdosys is on both 2000 and 2003.
really now?  I have server 2000 setup at home and it only has CDONTS installed?

http://www.portalfanatic.com/includes/comcheck.asp
WIN2000 - CDONTS (no CDOSYS)
WIN2003 - CDOSYS (NO CDOSYS WITH OS. However you can intall CDONTS by copying from Win2k OS and registering it)


Cheers
Randeep
>>WIN2003 - CDOSYS (NO CDOSYS WITH OS. However you can intall CDONTS by copying from Win2k OS and registering it)

read as
WIN2003 - CDOSYS (NO CDONTS WITH OS. However you can intall CDONTS by copying from Win2k OS and registering it)


CDOSYS was first available in Windows 2000 Server. As of December 2003, CDOSYS is an integral part of the Windows 2000, Windows XP, and Windows 2003 series of operating systems.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/exchanchor/htms/msexchsvr_cdowin2000.asp

i have used cdosys on 2000 servers.
well...as I said....CDONTS is default with Windows 2000  (mine was bought prior to December 2003)...so unless the questioner has a newer version of it on there server, then they more than likely have CDONTS

unless of course I'm lying, and it's not windows 2000 server that I have installed (which being around the scene for over a decade, I'm pretty sure it is Windows 2000 Server that is installed, as I installed it myself)

Besides the fact that the code the quesitoner has provided is used for CDONTS...........
i will not participate in another one of your flame wars, kevp75.  i was simply adding to your comment to give more information.
flame wars?  hmm.  

well, thank you for clarifying that, but I'm also not the only one who see's that cdonts is on w2k.  All i'm trying to do is give the correct information, and not confuse the asker.  I do see on MS that as of Dec. 2003 cdosys was the default, is there a download associated with it, as I know it wasn't part of any service pack (I have up to SP4 installed)