Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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>
Reply With Quote
  #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
Reply With Quote
  #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...
Reply With Quote
  #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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:02 PM.


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