dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: CDONTS to CDOSYS

  1. #1
    Join Date
    Sep 2003
    Posts
    27

    CDONTS to CDOSYS

    I am moving my web files to a new (Win2003) server which is seperate from the box that holds my email server. I am having trouble with the 'Contact Us' kinds of pages that used to use CDONTS but now use CDOSYS. I believe the problem is the sendusing deal but it may be a port issue. Here is my code:

    code:--------------------------------------------------------------------------------
    Dim iMail, iConf, Flds
    Dim sMsg, sName, sEmail, sSubject

    sName = Request.Form.Item("name")
    sEmail = Request.Form.Item("email")
    sSubject = Request.Form.Item("subject")
    sMsg = "From: " & sName & vbCrLf
    sMsg = sMsg & "Email: " & sEmail & vbCrLf & vbCrLf
    sMsg = sMsg & Request.Form.Item("message")

    Set iMail = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    Set Flds = iConf.Fields
    Flds "http://schemas.microsoft.com/cdo/configuration/sendusing") = 3
    Flds.Update

    Set iMail.Configuration = iConf
    With iMail
    .To = "me@mydomain.com"
    .From = sEmail
    .Subject = sSubject
    .TextBody = sMsg
    .Send
    End With

    Set iMail = Nothing
    Set iConf = Nothing
    Set Flds = Nothing
    --------------------------------------------------------------------------------


    I am open to suggestions. Thanks in advance!!!

  2. #2
    Join Date
    Jan 2003
    Location
    USA
    Posts
    688
    Here are changes I made to convert CDONTS stuff to be CDO stuff instead:

    o Change objCDONTS to be called objCDO (actually this is just a cosmetic change)

    o This:
    Set objCDONTS = Server.CreateObject("CDONTS.NewMail")

    Changed to this instead:
    Set objCDO = Server.CreateObject("CDO.Message")

    o This:
    objCDONTS.Body = strEmailBody

    Changed to this instead:
    objCDO.TextBody = strEmailBody

    o This removed:
    ' Importance.
    ' (0=Low, 1=Normal, 2=High)
    objCDONTS.Importance = 1

  3. #3
    Join Date
    Sep 2003
    Posts
    27
    Thanks for your help!

  4. #4
    Join Date
    Jan 2015
    Posts
    3

    CDONTS to CDOSYS mail script issue

    I am also having the same problem and was hoping somebody might help, because Im spending hours pulling my hair out. I had to change servers and they tell me Im using CDONTS object which is not supported. CDO and CDOSYS are available. CDONTS is not supported. I have tried to employ to different coders to this for me, but they just laugh. I don't get the joke.

    I would really appreiate any help that someone can give me to get the forms working on my site. I thank you in advance

    I have three main file to attached to the the website mail form and was looking for help to change from CDONTS object to CDO and CDOSYS. The 3 files are mail.asp, adovsbs.inc and cdonts.inc.

    /mail.asp

    <% Option Explicit %>
    <!-- #include file="adovbs.inc" -->
    <!--#include file="cdonts.inc" -->
    <%
    Dim Security
    Security = Trim(Request("security"))
    If Security <> "thanks" Then
    Response.Redirect "http://www."
    End If


    Dim NewMailObj
    Dim sMailBody
    Dim postFullname, postEmail, postAddress, postWeddingfireshow, postFireshow, postShcoolscircusskills, postCircusskills

    postFullname = Request("postFullname")
    postEmail = Request("postEmail")
    postAddress = Request("postAddress")
    postWeddingfireshow = Request("postWeddingfireshow")
    postFireshow = Request("postFireshow")
    postShcoolscircusskills = Request("postShcoolscircusskills")
    postCircusskills = Request("postCircusskills")

    Set NewMailObj = Server.CreateObject("CDONTS.NewMail")
    NewMailObj.From = "info@---"
    NewMailObj.To = "info@---.com"
    NewMailObj.BCC = "info@---.co.uk"
    NewMailObj.Subject = "Post Me Some Information"
    sMailBody = "" & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Information---------------------------------------- " & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Full Name " & postFullname & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Email " & postEmail & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Address " & postAddress & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Survice Type--------------------------------------- " & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Wedding fireshows " & postWeddingfireshow & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Fireshows " & postFireshow & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Schools circus skills " & postShcoolscircusskills & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Circus skills " & postCircusskills & vbNewLine & vbNewLine
    NewMailObj.Body = sMailBody
    NewMailObj.Send
    Set NewMailObj = Nothing

    %>


    /cdonts.inc


    <%
    ' CDONTS Constants

    ' CDONTS Attachment.Type values
    Const CdoFileData = 1
    Const CdoEmbeddedMessage = 4

    ' CDONTS Message.Importance Values. Also used in NewMail.Importance
    Const CdoLow = 0
    Const CdoNormal = 1
    Const CdoHigh = 2

    ' CDONTS Message.MessageFormat and Session.MessageFormat Values
    Const CdoMime = 0
    Const CdoText = 1

    ' CDONTS NewMail.AttachFile and NewMail.AttachURL EncodingMethod Values
    Const CdoEncodingUUencode = 0
    Const CdoEncodingBase64 = 1

    ' CDONTS NewMail.BodyFormat Values
    Const CdoBodyFormatHTML = 0
    Const CdoBodyFormatText = 1

    ' CDONTS NewMail.MailFormat Values
    Const CdoMailFormatMime = 0
    Const CdoMailFormatText = 1

    ' CDONTS Recipient.Type Values
    Const CdoTo = 1
    Const CdoCc = 2
    Const CdoBcc = 3

    ' CDONTS Session.GetDefaultFolder Values
    Const CdoDefaultFolderInbox = 1
    Const CdoDefaultFolderOutbox = 2
    %>


    <%

  5. #5
    Join Date
    Jan 2015
    Posts
    3

    CDONTS to CDOSYS mail script issue

    I am also having the same problem and was hoping somebody might help, because Im spending hours pulling my hair out. I had to change servers and they tell me Im using CDONTS object which is not supported. CDO and CDOSYS are available. CDONTS is not supported. I have tried to employ to different coders to this for me, but they just laugh. I don't get the joke.

    I would really appreiate any help that someone can give me to get the forms working on my site. I thank you in advance

    I have three main file to attached to the the website mail form and was looking for help to change from CDONTS object to CDO and CDOSYS. The 3 files are mail.asp, adovsbs.inc and cdonts.inc.

    /mail.asp

    <% Option Explicit %>
    <!-- #include file="adovbs.inc" -->
    <!--#include file="cdonts.inc" -->
    <%
    Dim Security
    Security = Trim(Request("security"))
    If Security <> "thanks" Then
    Response.Redirect "http://www."
    End If


    Dim NewMailObj
    Dim sMailBody
    Dim postFullname, postEmail, postAddress, postWeddingfireshow, postFireshow, postShcoolscircusskills, postCircusskills

    postFullname = Request("postFullname")
    postEmail = Request("postEmail")
    postAddress = Request("postAddress")
    postWeddingfireshow = Request("postWeddingfireshow")
    postFireshow = Request("postFireshow")
    postShcoolscircusskills = Request("postShcoolscircusskills")
    postCircusskills = Request("postCircusskills")

    Set NewMailObj = Server.CreateObject("CDONTS.NewMail")
    NewMailObj.From = "info@---"
    NewMailObj.To = "info@---.com"
    NewMailObj.BCC = "info@---.co.uk"
    NewMailObj.Subject = "Post Me Some Information"
    sMailBody = "" & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Information---------------------------------------- " & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Full Name " & postFullname & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Email " & postEmail & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Address " & postAddress & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Survice Type--------------------------------------- " & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Wedding fireshows " & postWeddingfireshow & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Fireshows " & postFireshow & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Schools circus skills " & postShcoolscircusskills & vbNewLine & vbNewLine
    sMailBody = sMailBody & " Post Circus skills " & postCircusskills & vbNewLine & vbNewLine
    NewMailObj.Body = sMailBody
    NewMailObj.Send
    Set NewMailObj = Nothing

    %>


    /cdonts.inc


    <%
    ' CDONTS Constants

    ' CDONTS Attachment.Type values
    Const CdoFileData = 1
    Const CdoEmbeddedMessage = 4

    ' CDONTS Message.Importance Values. Also used in NewMail.Importance
    Const CdoLow = 0
    Const CdoNormal = 1
    Const CdoHigh = 2

    ' CDONTS Message.MessageFormat and Session.MessageFormat Values
    Const CdoMime = 0
    Const CdoText = 1

    ' CDONTS NewMail.AttachFile and NewMail.AttachURL EncodingMethod Values
    Const CdoEncodingUUencode = 0
    Const CdoEncodingBase64 = 1

    ' CDONTS NewMail.BodyFormat Values
    Const CdoBodyFormatHTML = 0
    Const CdoBodyFormatText = 1

    ' CDONTS NewMail.MailFormat Values
    Const CdoMailFormatMime = 0
    Const CdoMailFormatText = 1

    ' CDONTS Recipient.Type Values
    Const CdoTo = 1
    Const CdoCc = 2
    Const CdoBcc = 3

    ' CDONTS Session.GetDefaultFolder Values
    Const CdoDefaultFolderInbox = 1
    Const CdoDefaultFolderOutbox = 2
    %>


    <%

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles