Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

IIS 6 dosent support CDONTS Help!

Posted on 2004-04-11
9
704 Views
Last Modified: 2007-12-19
Hello

I moved my WEB site to IIS6, 2003 server only to find that CDONTS is no longer supported.

I have several asp pages that where using Mysql statements to populate the SQL database then send the results via email using CDONTS.

Now that I have to USE the CDO object can anyone tell me what the syntax should be? HELP

This is a portion of the ASP page that was using mySQL and CDONTS.

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      mySQL= "INSERT INTO knowledge_base "
      mySQL= mySQL & "(date,contact_person,agency,contact_phone,contact_email,type_of_request,reason_for_change_enhancement,module,problem,display_cs,display,status,fix,support_username,client_display) "
      mySQL= mySQL & "VALUES ('" & Request.Form("date") & "','"
      mySQL= mySQL & Request.Form("contact_person") & "','"
      mySQL= mySQL & Request.Form("agency") & "','"
      mySQL= mySQL & Request.Form("contact_phone") & "','"
      mySQL= mySQL & Request.Form("contact_email") & "','"
      mySQL= mySQL & Request.Form("type_of_request") & "','"
      mySQL= mySQL & Request.Form("reason_for_change_enhancement") & "','"
      mySQL= mySQL & Request.Form("module") & "','"
      mySQL= mySQL & replace(Request.Form("problem"),"'","''") & "','"
     'mySQL= mySQL & Request.Form("problem") & "','"
      mySQL= mySQL & Request.Form("display_cs") & "','"
      mySQL= mySQL & Request.Form("display") & "','"
      mySQL= mySQL & Request.Form("status") & "','"
      mySQL= mySQL & Request.Form("fix") & "','"
      mySQL= mySQL & Request.Form("support_username") & "','"
      mySQL= mySQL & Request.Form("client_display") & "')"
          
      '========================================================
    ' Execute the connection with the SQL string.
    ' This runs the SQL string against the database and inputs
    ' the information.
    '=========================================================
myConnection.Execute mySQL
      
      '=== Close the connection.
      myConnection.Close
                  
      '=== Set the connection equal to Nothing.
    '=== This frees resources used by it.
      Set myConnection = Nothing

'====================================================================
    ' Set up variables:
    '      myCDONTSMail = A CDONTS mail object.
    '      strFrom = A string containing the source e-mail address.
    '      strTo = A string containing the destination e-mail address.
    '      strSubject = A string containing the subject of the e-mail.
    '      strBody = A string containing the body of the e-mail.
    '====================================================================
    Dim myCDONTSMail
    Dim strFrom
    Dim strTo,strCC
    Dim strSubject
    Dim strBody

      '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      ' Assign the source e-mail address. Change this to your e-mail
      ' address.
      '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    'strFrom="WebServer@somewhere.net"
    strFrom=Request.Form("contact_email")
    '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    ' Assign the destination e-mail address. In this example, get the
    ' e-mail address from the form field called "EMail".
    ' You can customize this by removing the EMail form field and
    ' changing the following line to this:
    '      strTo="example@microsoft.com" ß Change this to your e-mail
    ' address.
    '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    strTo="support@somewhere.net "
    strCC=Request.Form("contact_email")

    '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following line is the subject of the e-mail. You can change
' this to a subject that is customized to your liking.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strSubject = "Support Request"

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following lines create the body of the message. This can be
' anything you want it to be.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strBody="The following information was submitted:" & Chr(13)
strBody = strBody & Request.Form("date") & " " & Chr(13)
strBody = strBody & Request.Form("agency") & " " & Chr(13)
strBody = strBody & Request.Form("contact_email") & Chr(13)
strBody = strBody & Request.Form("type_of_request") & Chr(13)
strBody = strBody & Request.Form("reason_for_change_enhancement") & Chr(13)
strBody = strBody & Request.Form("module") & Chr(13)
strBody = strBody & Request.Form("problem") & Chr(13)
' strBody = strBody & Chr(13) & Request.Form("Address") & Chr(13)
' strBody = strBody & Request.Form("City") & Chr(13)
' strBody = strBody & Request.Form("Region") & Chr(13)
' strBody = strBody & Request.Form("PostalCode") & Chr(13)
strBody = strBody & Chr(13) & "thank you."

'====================================================================
' The SET statement creates the CDONTS mail object in preparation
' for sending the e-mail message.
'====================================================================
Set myCDONTSMail = CreateObject("CDONTS.NewMail")
  myCDONTSMail.Subject=strSubject
  myCDONTSMail.Body=strBody
  myCDONTSMail.From=strFrom
  myCDONTSMail.To=strTo
  myCDONTSMail.CC=strCC
  ' ** UNCOMMENT THE TWO LINES FOR HTML FORMATTING **
  'myCDONTSMail.BodyFormat=0
  'myCDONTSMail.MailFormat=0

'====================================================================
' The following line sends the mail message using the source e-mail,
' destination e-mail, subject, and body that were defined earlier.
'====================================================================
'myCDONTSMail.Send strFrom,strTo,strSubject,strBody
myCDONTSMail.Send

      '=== Set the CDONTS mail object to NOTHING to free resources.
Set myCDONTSMail = Nothing

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' For information about how to customize the rest of this page, see the
' Customizing the Confirmation Page section of this document. Sections
' that are discussed in the Customizations section are delimited
' by percent signs.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0
Comment
Question by:dhieb
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 20

Assisted Solution

by:jitganguly
jitganguly earned 25 total points
ID: 10803064
0
 
LVL 7

Accepted Solution

by:
brgivens earned 400 total points
ID: 10803267
0
 

Author Comment

by:dhieb
ID: 10803463
Thanks for the posts

For the moment I like the idea of registering the cdonts.dll
Unfortunately after registering the DLL I now get an “800a0046|Permission_denied” is the IIS log.
Any ideas?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 7

Expert Comment

by:brgivens
ID: 10803570
0
 
LVL 21

Assisted Solution

by:ap_sajith
ap_sajith earned 75 total points
ID: 10803637
Try out this code..

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     mySQL= "INSERT INTO knowledge_base "
      mySQL= mySQL & "(date,contact_person,agency,contact_phone,contact_email,type_of_request,reason_for_change_enhancement,module,problem,display_cs,display,status,fix,support_username,client_display) "
      mySQL= mySQL & "VALUES ('" & Request.Form("date") & "','"
      mySQL= mySQL & Request.Form("contact_person") & "','"
      mySQL= mySQL & Request.Form("agency") & "','"
      mySQL= mySQL & Request.Form("contact_phone") & "','"
      mySQL= mySQL & Request.Form("contact_email") & "','"
      mySQL= mySQL & Request.Form("type_of_request") & "','"
      mySQL= mySQL & Request.Form("reason_for_change_enhancement") & "','"
      mySQL= mySQL & Request.Form("module") & "','"
      mySQL= mySQL & replace(Request.Form("problem"),"'","''") & "','"
     'mySQL= mySQL & Request.Form("problem") & "','"
      mySQL= mySQL & Request.Form("display_cs") & "','"
      mySQL= mySQL & Request.Form("display") & "','"
      mySQL= mySQL & Request.Form("status") & "','"
      mySQL= mySQL & Request.Form("fix") & "','"
      mySQL= mySQL & Request.Form("support_username") & "','"
      mySQL= mySQL & Request.Form("client_display") & "')"
         
     '========================================================
    ' Execute the connection with the SQL string.
    ' This runs the SQL string against the database and inputs
    ' the information.
    '=========================================================
myConnection.Execute mySQL
     
     '=== Close the connection.
     myConnection.Close
               
     '=== Set the connection equal to Nothing.
    '=== This frees resources used by it.
     Set myConnection = Nothing

'====================================================================
    ' Set up variables:
    '     myCDONTSMail = A CDONTS mail object.
    '     strFrom = A string containing the source e-mail address.
    '     strTo = A string containing the destination e-mail address.
    '     strSubject = A string containing the subject of the e-mail.
    '     strBody = A string containing the body of the e-mail.
    '====================================================================
    Dim myCDONTSMail
    Dim strFrom
    Dim strTo,strCC
    Dim strSubject
    Dim strBody

     '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     ' Assign the source e-mail address. Change this to your e-mail
     ' address.
     '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    'strFrom="WebServer@somewhere.net"
    strFrom=Request.Form("contact_email")
    '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    ' Assign the destination e-mail address. In this example, get the
    ' e-mail address from the form field called "EMail".
    ' You can customize this by removing the EMail form field and
    ' changing the following line to this:
    '     strTo="example@microsoft.com" ß Change this to your e-mail
    ' address.
    '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    strTo="support@somewhere.net "
    strCC=Request.Form("contact_email")

    '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following line is the subject of the e-mail. You can change
' this to a subject that is customized to your liking.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strSubject = "Support Request"

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following lines create the body of the message. This can be
' anything you want it to be.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strBody="The following information was submitted:" & Chr(13)
strBody = strBody & Request.Form("date") & " " & Chr(13)
strBody = strBody & Request.Form("agency") & " " & Chr(13)
strBody = strBody & Request.Form("contact_email") & Chr(13)
strBody = strBody & Request.Form("type_of_request") & Chr(13)
strBody = strBody & Request.Form("reason_for_change_enhancement") & Chr(13)
strBody = strBody & Request.Form("module") & Chr(13)
strBody = strBody & Request.Form("problem") & Chr(13)
' strBody = strBody & Chr(13) & Request.Form("Address") & Chr(13)
' strBody = strBody & Request.Form("City") & Chr(13)
' strBody = strBody & Request.Form("Region") & Chr(13)
' strBody = strBody & Request.Form("PostalCode") & Chr(13)
strBody = strBody & Chr(13) & "thank you."

'====================================================================
' The following line sends the mail message using the source e-mail,
' destination e-mail, subject, and body that were defined earlier.
'====================================================================
'myCDONTSMail.Send strFrom,strTo,strSubject,strBody
'myCDONTSMail.Send
CALL SendMailCDOSYS(strFrom,strTo,strSubject,strBody,False,"localhost")
' Change the sMailServer parameter to "yourmailservername" if it is not localhost

'=== Set the CDONTS mail object to NOTHING to free resources.
'Set myCDONTSMail = Nothing

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' For information about how to customize the rest of this page, see the
' Customizing the Confirmation Page section of this document. Sections
' that are discussed in the Customizations section are delimited
' by percent signs.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

' Function to send email Using CDOSYS
'** USAGE **
'** strMailBody="<Font Color=Red><B>Test HTML String</B></Font>"
'** CALL SendMailCDOSYS("a@b.com","c@d.com","test",strMailBody,True,"mail.yahoo.com")

Sub SendMailCDOSYS(strFrom,strTO,strSubject,strMailBody,blnHTML,sMailServer)
On Error Resume Next
     Dim objCDOConf,objCDOSYS
     ' ** CREATE THE E-MAIL SERVER OBJECT **
     Set objCDOSYS = Server.CreateObject("CDO.Message")
     Set objCDOConf = Server.CreateObject ("CDO.Configuration")

     ' ** SET AND UPDATE FIELDS PROPERTIES **
     With objCDOConf
          ' ** OUT GOING SMTP SERVER **
          .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = sMailServer
          ' ** SMTP PORT **
          .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")  = 25
          ' ** CDO PORT **
          .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
          ' ** TIMEOUT **
          .Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
          .Fields.Update
     End With

     ' ** UPDATE THE CDOSYS CONFIGURATION **
     Set objCDOSYS.Configuration = objCDOConf

     With objCDOSYS    
          ' ** WHO THE E-MAIL IS FROM **
          .From = strFrom

          ' ** WHO THE E-MAIL IS SENT TO **
          .To = strTo
                   
          ' ** THE SUBJECT OF THE E-MAIL **
          .Subject = strSubject
           
          ' ** SET THE E-MAIL BODY FORMAT (HTMLBody=HTML TextBody=Plain) **
          If blnHTML = True Then
          .HTMLBody = strMailBody
          Else
          .TextBody = strMailBody
          End If
           
          ' ** SEND THE E-MAIL **
          .Send
     End with                    
       
     ' ** CLOSE THE SERVER MAIL OBJECT **
     Set objCDOSYS = Nothing
End Sub


Cheers!!
0
 

Author Comment

by:dhieb
ID: 10803676
ap_sajith

Thanks for the effort I will give it a go.
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 10805046
>>For the moment I like the idea of registering the cdonts.dll

Thats not a good idea. Why would you use somethign that doesn't really support ? I am not against it, but is there a isue using CDO ?
instead of CDONTS ?
0
 

Author Comment

by:dhieb
ID: 10810638

Thanks,

No, the only issue at the moment is that  IIS6 and CDO was an unexpected delay. I couldnt hold off on some server moves.
But I do appreciate the input. Converting to CDO will occur just not today.

Thanks
0
 

Author Comment

by:dhieb
ID: 10810641
Thanks everone for the input....
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Summernote required 3 184
Using querystring in a hyperlink 3 56
Why Bundles is not working on certain files - ASP MVC 3 60
Classic ASP application Will support SQL 2014 5 94
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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