Solved

CDONT problem

Posted on 2004-04-19
26
568 Views
Last Modified: 2007-12-19
Hi there

When trying to run a script that uses the CDONT email component i get the following error:

Server object, ASP 0178 (0x80070005)
The call to Server.CreateObject failed while checking permissions. Access is denied to this object.
/Booking/dont.asp, line 23

I hope someone can help

I am using IIS 5 on windows XP

thanks
Pungwick
0
Comment
Question by:Pungwick
  • 14
  • 6
  • 5
  • +1
26 Comments
 
LVL 1

Author Comment

by:Pungwick
ID: 10862121
I also try another chuck of cdonts code and get this:

Permission denied: 'CreateObject'
/Booking/CDONTSMail.asp, line 48


 Set myCDONTSMail = CreateObject("CDONTS.NewMail") <--Line  48

I hope someone can help
thanks
0
 
LVL 5

Expert Comment

by:chaniewskim
ID: 10862656
I don't know why 'Permission Denied', I can look into it,
but check first if you have cdonts.dll at all (should be in windows\system32)!

As far as I remember it is not installed winth Windows XP, only with Windows 2000. If so, you have to get it, put it into system32 and register with regsvr32.exe

Does it help you?
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10862774
Hi there

I have got cdonts working:) but it only seems to work for some code not others which is weird. Do you have some cdonts code that you belive is very good and works, if so you could post it here. Also How do you get instant email recieval??? Do you have any super sonice cdonts code, hehe :)

hope you can help

Thanks
Pungwick
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Expert Comment

by:irish_coffee
ID: 10862793
Windows XP does not using CDONTS.dll
WinXp using CDOSYS.dll
please check it..
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10862819
Sorry irish_coffee I dont understand what you mean. I know that CDonts isnt standard on XP however if you install the cdonts.dll file you can use it

thanks
0
 
LVL 5

Expert Comment

by:chaniewskim
ID: 10862884
If you have cdonts.dll file installed, ensure it has Execute permission set for you ASP user account.
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10862896
How do you set up executable permisions?
0
 
LVL 5

Expert Comment

by:chaniewskim
ID: 10862948
right-click file, properties, security tab, check 'Read and execute' for appropriate user
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10862960
that is the cdont.dll file?

have you got any CDonts code you can post here? Some that is very very fast

thanks
0
 
LVL 5

Expert Comment

by:chaniewskim
ID: 10863017
yes, set 'read and execute' for cdonts.dll

I have some code, a procedure (Sub) for sending an HTML email using CDONTS:

sub SendEmail(recipee, subject, body, from, replyTo)
      set oCDO = Server.CreateObject("CDONTS.NewMail")
      oCDO.From = from
      oCDO.Value("Reply-To") = replyTo
      oCDO.to = recipee
      oCDO.Subject = subject
      oCDO.Body = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN""><html><head></head><body style=""font-family:verdana;font-size:9pt;background-color:#fffff0"">" & body & "</body></html>"
      oCDO.Importance = 2
      oCDO.MailFormat = 0
      oCDO.BodyFormat = 0
      oCDO.Send
      set oCDO = nothing
end Sub
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10863110
How would  I use this code???

could you give me example oh how I could send an email using it???

thanks
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10863115
I was thinking more of using a form with asp

thanks
0
 
LVL 5

Expert Comment

by:chaniewskim
ID: 10863141
Sorry, I don't have that kind of code. I was using CDONTS only for administrative notifications.
Were you able to set those Execute rights? Did it help?
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10863214
I had set those rights prior to starting this thread
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10863216
I had set those rights prior to starting this thread
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10867218
Example of CDONTS - with a form.

Form has some basic validation for a few fields - on submitted the email is sent and a message is displayed saying the message was sent.

This page is functioning as works 'as is'.

Email_Form.asp  ===============================================================================================================
<%@ Language=VBScript %>
<%Option Explicit%>
<%
Dim objMail
Dim sForm(6), sEmail(1), sErrMsg, sBody
Dim iLp

sEmail(0) = "peter@internection.co.uk"
sEmail(1) = "proome@hotmail.com"

If Request.Form("B1") = "Submit" then
      sErrMsg = ""
      
      For iLp = 0 to 6
            sForm(iLp) = Trim(Request.Form("f_"&iLp))
      Next
      
      If sForm(1) = "" then
            sErrMsg = "ERROR: From - required."
      Else
            If sForm(2) = "" then
                  sErrMsg = "ERROR: Description - required."
            Else
                  If sForm(6) = "" then
                        sErrMsg = "ERROR: Message - required."
                  End If
            End If
      End If
      
      If sErrMsg = "" then
            sBody = ""
            sBody = sBody & "<!DOCTYPE HTML PUBLIC '-//IETF//DTD HTML//EN'>"
            sBody = sBody & "<html>"
            sBody = sBody & "<head>"
            sBody = sBody & "<title>Message...</title>"
            sBody = sBody & "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>"
            sBody = sBody & "</head>"
            sBody = sBody & "<body>"
            sBody = sBody & "<font face='Verdana' size='2' color='#000000'>"
            sBody = sBody & "You have received a message:<br><br>"
            sBody = sBody & "From: <b>" & sForm(1) & "</b><br><br>"
            sBody = sBody & "Description: <b>" & sForm(2) & "</b><br>"
            sBody = sBody & "Phone #: <b>" & sForm(3) & "</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ext #: <b>" & sForm(4) & "</b><br>"
            sBody = sBody & "Other #: <b>" & sForm(5) & "</b><br><br>"
            sBody = sBody & "The Message:<br>"
            sBody = sBody & "================================================<br>"
            sBody = sBody & "<b>" & sForm(6) & "</b>"
            sBody = sBody & "</font>"
            sBody = sBody & "</body>"
            sBody = sBody & "</html>"
                                    
            Set objMail = Server.CreateObject("CDONTS.NewMail")
            objMail.BodyFormat = 0
            objMail.MailFormat = 0
            objMail.To = sForm(0)
            objMail.From = sForm(1)
            objMail.Subject = "Message From " & sForm(0)
            objMail.Body = sBody
            objMail.Send
            
            For iLp = 0 to 6
                  sForm(iLp) = ""
            Next
            
            sErrMsg = "NOTICE: Message sent."
      End If
End If

%>
<html>

<head>
<title>Email</title>
</head>
<body>
<form method="POST" action="Email_Form.asp">
<table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="400">
      <tr>
            <td colspan="3" height="30" align="center"><b>MESSAGE CENTRE</b></td>
      </tr>
      <%If sErrMsg <> "" then%>
            <tr>
                  <td colspan="3" height="25"><%=sErrMsg%></td>
            </tr>
      <%End If%>
      <tr>
            <td width="100" height="25" align="right">Message To:&nbsp;</td>
            <td colspan="2">
                  <select size="1" name="f_0">
                        <%For iLp = 0 to UBound(sEmail)
                              If sForm(0) = sEmail(iLp) then%>
                                    <option value="<%=sEmail(iLp)%>" selected><%=sEmail(iLp)%></option>
                              <%Else%>
                                    <option value="<%=sEmail(iLp)%>"><%=sEmail(iLp)%></option>
                              <%End If
                        Next%>
                  </select>
            </td>
      </tr>
      <tr>
            <td height="25" align="right">From:&nbsp;</td>
            <td colspan="2">
                  <input type="text" name="f_1" size="29" value="<%=sForm(1)%>">
            </td>
      </tr>
      <tr>
            <td height="25" align="right">Description:&nbsp;</td>
            <td colspan="2">
                  <input type="text" name="f_2" size="33" value="<%=sForm(2)%>">
            </td>
      </tr>
      <tr>
            <td height="25" align="right">Phone #:&nbsp;</td>
            <td><input type="text" name="f_3" size="18" value="<%=sForm(3)%>"></td>
            <td width="100">
                  Ext:&nbsp;<input type="text" name="f_4" size="6" value="<%=sForm(4)%>">
            </td>
      </tr>
      <tr>
            <td height="25" align="right">Other #:&nbsp;</td>
            <td colspan="2">
                  <input type="text" name="f_5" size="18" value="<%=sForm(5)%>">
            </td>
      </tr>
      <tr>
            <td colspan="3" height="25" align="center">Message:</td>
      </tr>
      <tr>
            <td colspan="3">
                  <textarea rows="6" name="f_6" style="WIDTH: 400; HEIGHT: 100"><%=sForm(6)%></textarea>
            </td>
      </tr>
      <tr>
            <td colspan="3" height="25" align="center">
                  <input type="submit" value="Submit" name="B1">
            </td>
      </tr>
</table>
</form>
</body>
</html>
==========================================================================================================================
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10867269
Thanks for the code, but how come it isnt instant ? I still havent recieved the email.

Also how can i change the option value so instead of having an option a query string value ie someone's email address is used instead

Hope you can help thanks
Pungwick
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10867306
You're running it from your machine is that right? Do you have the default SMTP server installed (its a windows component), it then need to be running. If its already there - do you have an either of the following folders on your machine:

C:\Inetpub\mailroot\Queue
C:\Inetpub\mailroot\Pickup

Look in here - if the emails are there then there is something not quite right with your SMTP services (providing they are running) - if there is a problem and they're not going I don't know what to suggest. Maybe you SMPT servers only scheduled to send mail every 15 mins - it could be a host of things.

Query: you need to change that according to your db....
<%'Do you connection
Set rsList = Server.CreateObject("ADODB.REcordSet")
sQuery = "SELECT EmailAddress FROM People"
rsList.Open sQuery, objCon

Put this bit in the form...
<select name="">
    <%Do while not rsList.EOF%>
          <option value="<%=rsList("EmailAddress")%>"><%=rsList("EmailAddress")%></option>
         <%rsList.MoveNext
      <%Loop%>
</select>

Hope that sorts you out :)
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10867323
Hi there

The words SMTP server  seem to pop up again:) so in order to use CDonts must I have this set up??? If so would you be able to give me some advise on how I can so.

C:\Inetpub\mailroot\Queue - This folder exists and hols the email I sent using you code
C:\Inetpub\mailroot\Pickup - Exist also but is empty.

Hope you cn help
Thanks
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10867339
I have opened up :

C:\Inetpub\mailroot\Badmail

and have a whole list of bad mail that has failed to get sent. Hope you can help thanks
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10867446
I don't know what to suggest - i have other people look after things like mail and the like - i'm just a poor little programmer :)
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10867489
hehehe :)

Seeing as tho you are that would you be kind enough to particpiate in another thread i started, yur programming knowledge will be of great assistance to me :)

thanks

http://www.experts-exchange.com/Web/Q_20960141.html

0
 
LVL 6

Accepted Solution

by:
Lord_McFly earned 50 total points
ID: 10885448
Do you need any more assistance on this question?
0
 
LVL 1

Author Comment

by:Pungwick
ID: 10888047
Hi,

Just a last thing, when I try to send an email all the messages get queued. When i restart my machine the messages get send? I have disabled my anti virus but still have the same issue. I hope you can help , thanks.

Also have you had the chance to have a look at the code for the other thread :) The ponits for this question are yours :)

thanks
Pungwick
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10897705
I didn't know which question it was so I went and put the 'Do you need... in all questions up until the 19th hoping that I would get some closed and identify any that I was still actively involved in, you've responsed - so I can get back on track now :)

As for the email not going - when do you disable your anti-virus software after you've started the machine or is it diabled permenently? It might be that the ports get blocked once you machine has booted up and after you disable anti-virus software.

Does you anti-virus sftware have integrated Firewall software as well - check that port 25 is not blocked (port emails are sent out on)
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10940704
Any luck in sorting out the 'emails not sending' problem?

Cheers

McFly
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP extract HTML using DOMXpath from nested tables 8 56
Remove lines by logo 2 31
PHP Form Calculate Total Price 10 44
Create an automated page index 9 19
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question