Solved

IIS 6 dosent support CDONTS Help!

Posted on 2004-04-11
9
706 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 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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
IP API - need data... 4 31
Hide Table in merge 3 41
Pass SQL to JSON. Page is in classic ASP and using Jquery 4 40
SP converting date time to date and time separately 2 20
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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 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