Solved

IIS 6 dosent support CDONTS Help!

Posted on 2004-04-11
9
703 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
INNER JOIN ? 8 47
Auto Submit on dropdown box 3 77
Time Conversions...both ways 2 16
Html form and modal / img src -problem 3 12
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…

821 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