?
Solved

IIS 6 dosent support CDONTS Help!

Posted on 2004-04-11
9
Medium Priority
?
713 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
[X]
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
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 20

Assisted Solution

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

Accepted Solution

by:
brgivens earned 1600 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 21

Assisted Solution

by:ap_sajith
ap_sajith earned 300 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

765 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