Solved

CDONT problem

Posted on 2004-04-19
26
559 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Expert Comment

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

Author Comment

by:Pungwick
Comment Utility
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
Comment Utility
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
Comment Utility
How do you set up executable permisions?
0
 
LVL 5

Expert Comment

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

Author Comment

by:Pungwick
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I was thinking more of using a form with asp

thanks
0
 
LVL 5

Expert Comment

by:chaniewskim
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 1

Author Comment

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

Author Comment

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

Expert Comment

by:Lord_McFly
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Do you need any more assistance on this question?
0
 
LVL 1

Author Comment

by:Pungwick
Comment Utility
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
Comment Utility
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
Comment Utility
Any luck in sorting out the 'emails not sending' problem?

Cheers

McFly
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now