Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 14th, 2005, 06:34 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to remove this CDO error

ActiveX component can't create object: 'CDO.Message'

m getting this error with following asp page

<%@ Language=VBScript %>
<HTML>
    <HEAD>
        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <script id=clientEventHandlersJS language=vbscript>


function Button1_onclick()
    set myMail=CreateObject("CDO.Message")
    myMail.Subject="Sending email with CDO"
    myMail.From="mailid@mydomain.com"
    myMail.To="mailid@somedomain.com"
    myMail.HTMLBody = "<h1>This is a message.</h1>"
    myMail.Send
    set myMail=nothing
end function


</script>
</HEAD>
    <body>
        <DIV ms_positioning="GridLayout">
            <TABLE height="408" cellSpacing="0" cellPadding="0" width="472" border="0" ms_2d_layout="TRUE">
                <TR vAlign="top">
                    <TD width="64" height="64"></TD>
                    <TD width="408"></TD>
                </TR>
                <TR vAlign="top">
                    <TD height="344"></TD>
                    <TD><INPUT id="Button1" type="button" value="Button" name="Button1" onclick="Button1_onclick()"></TD>
                </TR>
            </TABLE>
        </DIV>
    </body>
</HTML>
  #2 (permalink)  
Old September 26th, 2005, 04:19 AM
Authorized User
 
Join Date: Aug 2004
Location: Delhi, Delhi, India.
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Prabhakar_dt
Default

Hi..All sever does not support CDO. First check which Mail component your server is supporting then try it...




Prabhakar Kumar
  #3 (permalink)  
Old October 3rd, 2005, 08:39 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

oh! no.... i was to ask that how shud i call these things on button click..
wtever i did in function Button1_onclick()
if i put that stuff on page load...it works....
but m not getting how shall i do that on button click...
  #4 (permalink)  
Old October 6th, 2005, 04:00 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

The reason you were getting that error was that the code was running client-side & your browser would not allow it to create ActiveX controls not marked as safe. This approach requires that all users use IE and have CDO on their machines which IMHO is undesirable.

A simple way to do what you want in classic asp is to submit a form to another page and send the mail from there server-side.

HTH,

Chris



Similar Threads
Thread Thread Starter Forum Replies Last Post
CDO Email error Treefarn Classic ASP Professional 10 February 20th, 2007 02:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.