Having to Chabge from CDONTS to CDO can anyone help

Discussion in 'ASP General' started by kevin@pennygate.myzen.co.uk, Jan 12, 2008.

  1. Guest

    Hi
    I have just changed hosting companys and my mail forms I find this is
    because new provider does not support CDONT anymore. Below is my
    original sent asp using CDONT and below that is my attemt to recode
    using CDO but it does not work.

    Can anyone plesee enter the missing lines

    The error

    CDO.Message.1 error '80040220'

    The "SendUsing" configuration value is invalid.

    /sent.asp, line 110
    ------------------------------------------------------------------------------------------------------------------------------------------------
    Old code taking variables from a form
    Dim MyBody
    Dim MyCDONTSMail

    Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    MyCDONTSMail.From= ""
    MyCDONTSMail.To= ""
    MyCDONTSMail.Subject="Message via plasmacab.co.uk website"
    MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    MyBody = MyBody & "Message Time: " & now()
    MyCDONTSMail.Body= MyBody

    MyCDONTSMail.Send
    set MyCDONTSMail=nothing
    -----------------------------------------------------------------------------------------------------------------------------------------------
    Code I have tried to change
    <%
    Dim MyBody
    Dim MyMail

    MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &
    vbCrLf
    MyBody = MyBody & "Message Time: " & now()

    Set MyMail=CreateObject("CDO.Message")
    MyMail.Subject="Message via plasmacab.co.uk website"
    MyMail.From=""
    MyMail.To=""

    MyMail.TextBody = MyBody
    MyMail.Send
    set MyMail=nothing

    %>
    </HTML>

    Thanks
    Kevin
    , Jan 12, 2008
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    > Hi
    > I have just changed hosting companys and my mail forms I find this is
    > because new provider does not support CDONT anymore. Below is my
    > original sent asp using CDONT and below that is my attemt to recode
    > using CDO but it does not work.
    >
    > Can anyone plesee enter the missing lines
    >
    > The error
    >
    > CDO.Message.1 error '80040220'
    >
    > The "SendUsing" configuration value is invalid.
    >
    > /sent.asp, line 110
    > --------------------------------------------------------------------------

    ----------------------------------------------------------------------
    > Old code taking variables from a form
    > Dim MyBody
    > Dim MyCDONTSMail
    >
    > Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    > MyCDONTSMail.From= ""
    > MyCDONTSMail.To= ""
    > MyCDONTSMail.Subject="Message via plasmacab.co.uk website"
    > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    > MyBody = MyBody & "Message Time: " & now()
    > MyCDONTSMail.Body= MyBody
    >
    > MyCDONTSMail.Send
    > set MyCDONTSMail=nothing
    > --------------------------------------------------------------------------

    ---------------------------------------------------------------------
    > Code I have tried to change
    > <%
    > Dim MyBody
    > Dim MyMail
    >
    > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &
    > vbCrLf
    > MyBody = MyBody & "Message Time: " & now()
    >
    > Set MyMail=CreateObject("CDO.Message")
    > MyMail.Subject="Message via plasmacab.co.uk website"
    > MyMail.From=""
    > MyMail.To=""
    >
    > MyMail.TextBody = MyBody
    > MyMail.Send
    > set MyMail=nothing
    >
    > %>
    > </HTML>
    >


    Code looks fine (Although I would use Server.CreateObject not just
    CreateObject but I don't think would be the problem).

    Sounds like the Server Extensions Mail Options haven't been configured for
    the site.

    Alternative you can set the configuration fields yourself:-

    Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")

    With oConfig.Fields
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
    = "127.0.0.1" ' Change this to the actual server name or address
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    .Update
    End With

    Set MyMail.Configuration = oConfig

    --
    Anthony Jones - MVP ASP/ASP.NET
    Anthony Jones, Jan 12, 2008
    #2
    1. Advertising

  3. Guest

    On 12 Jan, 14:12, "Anthony Jones" <> wrote:
    > <> wrote in message
    >
    > news:...
    >
    > > Hi
    > > I have just changed hosting companys and my mail forms I find this is
    > > because new provider does not support CDONT anymore. Below is my
    > > original sent asp using CDONT and below that is my attemt to recode
    > > using CDO but it does not work.

    >
    > > Can anyone plesee enter the missing lines

    >
    > > The error

    >
    > > CDO.Message.1 error '80040220'

    >
    > > The "SendUsing" configuration value is invalid.

    >
    > > /sent.asp, line 110
    > > --------------------------------------------------------------------------

    >
    > ----------------------------------------------------------------------
    >
    > > Old code taking variables from a form
    > > Dim MyBody
    > > Dim MyCDONTSMail

    >
    > > Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    > > MyCDONTSMail.From= ""
    > > MyCDONTSMail.To= ""
    > > MyCDONTSMail.Subject="Message via plasmacab.co.uk website"
    > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    > > MyBody = MyBody & "Message Time: " & now()
    > > MyCDONTSMail.Body= MyBody

    >
    > > MyCDONTSMail.Send
    > > set MyCDONTSMail=nothing
    > > --------------------------------------------------------------------------

    >
    > ---------------------------------------------------------------------
    >
    >
    >
    > > Code I have tried to change
    > > <%
    > > Dim MyBody
    > > Dim MyMail

    >
    > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &
    > > vbCrLf
    > > MyBody = MyBody & "Message Time: " & now()

    >
    > > Set MyMail=CreateObject("CDO.Message")
    > > MyMail.Subject="Message via plasmacab.co.uk website"
    > > MyMail.From=""
    > > MyMail.To=""

    >
    > > MyMail.TextBody = MyBody
    > > MyMail.Send
    > > set MyMail=nothing

    >
    > > %>
    > > </HTML>

    >
    > Code looks fine (Although I would use Server.CreateObject not just
    > CreateObject but I don't think would be the problem).
    >
    > Sounds like the Server Extensions Mail Options haven't been configured for
    > the site.
    >
    > Alternative you can set the configuration fields yourself:-
    >
    > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    >
    > With oConfig.Fields
    > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
    > = "127.0.0.1" ' Change this to the actual server name or address
    > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    > .Update
    > End With
    >
    > Set MyMail.Configuration = oConfig
    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET


    I have changed the code as suggested but now get an error message
    object required line 104
    here is my amended script
    <%
    Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    Dim MyBody
    Dim MyMail

    With oConfig.Fields
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
    "mailhost.zen.co.uk"
    .Item("http://schemas.microsoft.com/cdo/configuration/
    smtpserverport") = 25
    .Update
    End With


    Set MyMail.Configuration = oConfig


    MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    MyBody = MyBody & "Message Time: " & now()

    Set MyMail=CreateObject("CDO.Message")
    MyMail.Subject="Message via plasmacab.co.uk website"
    MyMail.From=""
    MyMail.To=""

    MyMail.TextBody = MyBody
    MyMail.Send
    set MyMail=nothing

    %>
    </HTML>
    Thanks
    , Jan 12, 2008
    #3
  4. <> wrote in message
    news:...
    > On 12 Jan, 14:12, "Anthony Jones" <> wrote:
    > > <> wrote in message
    > >
    > > news:...
    > >
    > > > Hi
    > > > I have just changed hosting companys and my mail forms I find this is
    > > > because new provider does not support CDONT anymore. Below is my
    > > > original sent asp using CDONT and below that is my attemt to recode
    > > > using CDO but it does not work.

    > >
    > > > Can anyone plesee enter the missing lines

    > >
    > > > The error

    > >
    > > > CDO.Message.1 error '80040220'

    > >
    > > > The "SendUsing" configuration value is invalid.

    > >
    > > > /sent.asp, line 110

    > >

    > --------------------------------------------------------------------------
    > >
    > > ----------------------------------------------------------------------
    > >
    > > > Old code taking variables from a form
    > > > Dim MyBody
    > > > Dim MyCDONTSMail

    > >
    > > > Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    > > > MyCDONTSMail.From= ""
    > > > MyCDONTSMail.To= ""
    > > > MyCDONTSMail.Subject="Message via plasmacab.co.uk website"
    > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    > > > MyBody = MyBody & "Message Time: " & now()
    > > > MyCDONTSMail.Body= MyBody

    > >
    > > > MyCDONTSMail.Send
    > > > set MyCDONTSMail=nothing

    > >

    > --------------------------------------------------------------------------
    > >
    > > ---------------------------------------------------------------------
    > >
    > >
    > >
    > > > Code I have tried to change
    > > > <%
    > > > Dim MyBody
    > > > Dim MyMail

    > >
    > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &
    > > > vbCrLf
    > > > MyBody = MyBody & "Message Time: " & now()

    > >
    > > > Set MyMail=CreateObject("CDO.Message")
    > > > MyMail.Subject="Message via plasmacab.co.uk website"
    > > > MyMail.From=""
    > > > MyMail.To=""

    > >
    > > > MyMail.TextBody = MyBody
    > > > MyMail.Send
    > > > set MyMail=nothing

    > >
    > > > %>
    > > > </HTML>

    > >
    > > Code looks fine (Although I would use Server.CreateObject not just
    > > CreateObject but I don't think would be the problem).
    > >
    > > Sounds like the Server Extensions Mail Options haven't been configured

    for
    > > the site.
    > >
    > > Alternative you can set the configuration fields yourself:-
    > >
    > > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    > >
    > > With oConfig.Fields
    > > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
    > > = "127.0.0.1" ' Change this to the actual server name or address
    > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")

    = 25
    > > .Update
    > > End With
    > >
    > > Set MyMail.Configuration = oConfig
    > >
    > > --
    > > Anthony Jones - MVP ASP/ASP.NET

    >
    > I have changed the code as suggested but now get an error message
    > object required line 104
    > here is my amended script
    > <%
    > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    > Dim MyBody
    > Dim MyMail
    >
    > With oConfig.Fields
    > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
    > "mailhost.zen.co.uk"
    > .Item("http://schemas.microsoft.com/cdo/configuration/
    > smtpserverport") = 25
    > .Update
    > End With
    >
    >
    > Set MyMail.Configuration = oConfig


    You haven`t created MyMail yet!!

    I didn`t intend you to insert the code verbatim.

    >
    >
    > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    > MyBody = MyBody & "Message Time: " & now()
    >
    > Set MyMail=CreateObject("CDO.Message")
    > MyMail.Subject="Message via plasmacab.co.uk website"
    > MyMail.From=""
    > MyMail.To=""
    >
    > MyMail.TextBody = MyBody
    > MyMail.Send
    > set MyMail=nothing
    >
    > %>
    > </HTML>





    --
    Anthony Jones - MVP ASP/ASP.NET
    Anthony Jones, Jan 12, 2008
    #4
  5. Guest

    On 12 Jan, 22:56, "Anthony Jones" <> wrote:
    > <> wrote in message
    >
    > news:...
    >
    >
    >
    > > On 12 Jan, 14:12, "Anthony Jones" <> wrote:
    > > > <> wrote in message

    >
    > > >news:...

    >
    > > > > Hi
    > > > > I have just changed hosting companys and my mail forms I find this is
    > > > > because new provider does not support CDONT anymore. Below is my
    > > > > original sent asp using CDONT and below that is my attemt to recode
    > > > > using CDO but it does not work.

    >
    > > > > Can anyone plesee enter the missing lines

    >
    > > > > The error

    >
    > > > > CDO.Message.1 error '80040220'

    >
    > > > > The "SendUsing" configuration value is invalid.

    >
    > > > > /sent.asp, line 110

    >
    > > --------------------------------------------------------------------------

    >
    > > > ----------------------------------------------------------------------

    >
    > > > > Old code taking variables from a form
    > > > > Dim MyBody
    > > > > Dim MyCDONTSMail

    >
    > > > > Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    > > > > MyCDONTSMail.From= ""
    > > > > MyCDONTSMail.To= ""
    > > > > MyCDONTSMail.Subject="Message via plasmacab.co.uk website"
    > > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    > > > > MyBody = MyBody & "Message Time: " & now()
    > > > > MyCDONTSMail.Body= MyBody

    >
    > > > > MyCDONTSMail.Send
    > > > > set MyCDONTSMail=nothing

    >
    > > --------------------------------------------------------------------------

    >
    > > > ---------------------------------------------------------------------

    >
    > > > > Code I have tried to change
    > > > > <%
    > > > > Dim MyBody
    > > > > Dim MyMail

    >
    > > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &
    > > > > vbCrLf
    > > > > MyBody = MyBody & "Message Time: " & now()

    >
    > > > > Set MyMail=CreateObject("CDO.Message")
    > > > > MyMail.Subject="Message via plasmacab.co.uk website"
    > > > > MyMail.From=""
    > > > > MyMail.To=""

    >
    > > > > MyMail.TextBody = MyBody
    > > > > MyMail.Send
    > > > > set MyMail=nothing

    >
    > > > > %>
    > > > > </HTML>

    >
    > > > Code looks fine (Although I would use Server.CreateObject not just
    > > > CreateObject but I don't think would be the problem).

    >
    > > > Sounds like the Server Extensions Mail Options haven't been configured

    > for
    > > > the site.

    >
    > > > Alternative you can set the configuration fields yourself:-

    >
    > > > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")

    >
    > > > With oConfig.Fields
    > > > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    > > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
    > > > = "127.0.0.1" ' Change this to the actual server name or address
    > > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")

    > = 25
    > > > .Update
    > > > End With

    >
    > > > Set MyMail.Configuration = oConfig

    >
    > > > --
    > > > Anthony Jones - MVP ASP/ASP.NET

    >
    > > I have changed the code as suggested but now get an error message
    > > object required line 104
    > > here is my amended script
    > > <%
    > > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    > > Dim MyBody
    > > Dim MyMail

    >
    > > With oConfig.Fields
    > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
    > > "mailhost.zen.co.uk"
    > > .Item("http://schemas.microsoft.com/cdo/configuration/
    > > smtpserverport") = 25
    > > .Update
    > > End With

    >
    > > Set MyMail.Configuration = oConfig

    >
    > You haven`t created MyMail yet!!
    >
    > I didn`t intend you to insert the code verbatim.
    >
    >
    >
    >
    >
    > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    > > MyBody = MyBody & "Message Time: " & now()

    >
    > > Set MyMail=CreateObject("CDO.Message")
    > > MyMail.Subject="Message via plasmacab.co.uk website"
    > > MyMail.From=""
    > > MyMail.To=""

    >
    > > MyMail.TextBody = MyBody
    > > MyMail.Send
    > > set MyMail=nothing

    >
    > > %>
    > > </HTML>

    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET


    Then I don't know how to create mail I thought the variables were
    being brought in from the form contact.asp a form with contact
    details that then loads sent.asp
    Thanks
    , Jan 13, 2008
    #5
  6. <> wrote in message
    news:...
    > On 12 Jan, 22:56, "Anthony Jones" <> wrote:
    > > <> wrote in message
    > >
    > > news:...
    > >
    > >
    > >
    > > > On 12 Jan, 14:12, "Anthony Jones" <> wrote:
    > > > > <> wrote in message

    > >
    > > >

    >news:...
    > >
    > > > > > Hi
    > > > > > I have just changed hosting companys and my mail forms I find this

    is
    > > > > > because new provider does not support CDONT anymore. Below is my
    > > > > > original sent asp using CDONT and below that is my attemt to

    recode
    > > > > > using CDO but it does not work.

    > >
    > > > > > Can anyone plesee enter the missing lines

    > >
    > > > > > The error

    > >
    > > > > > CDO.Message.1 error '80040220'

    > >
    > > > > > The "SendUsing" configuration value is invalid.

    > >
    > > > > > /sent.asp, line 110

    > >
    > >

    > --------------------------------------------------------------------------
    > >
    > > >

    > ----------------------------------------------------------------------
    > >
    > > > > > Old code taking variables from a form
    > > > > > Dim MyBody
    > > > > > Dim MyCDONTSMail

    > >
    > > > > > Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    > > > > > MyCDONTSMail.From= ""
    > > > > > MyCDONTSMail.To= ""
    > > > > > MyCDONTSMail.Subject="Message via plasmacab.co.uk website"
    > > > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > > > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &

    vbCrLf
    > > > > > MyBody = MyBody & "Message Time: " & now()
    > > > > > MyCDONTSMail.Body= MyBody

    > >
    > > > > > MyCDONTSMail.Send
    > > > > > set MyCDONTSMail=nothing

    > >
    > >

    > --------------------------------------------------------------------------
    > >
    > > >

    > ---------------------------------------------------------------------
    > >
    > > > > > Code I have tried to change
    > > > > > <%
    > > > > > Dim MyBody
    > > > > > Dim MyMail

    > >
    > > > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > > > MyBody = MyBody & "Email Address: " & request ("Email")&

    vbCrLf
    > > > > > MyBody = MyBody & "Telephone: " & request ("Telephone")&

    vbCrLf
    > > > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &
    > > > > > vbCrLf
    > > > > > MyBody = MyBody & "Message Time: " & now()

    > >
    > > > > > Set MyMail=CreateObject("CDO.Message")
    > > > > > MyMail.Subject="Message via plasmacab.co.uk website"
    > > > > > MyMail.From=""
    > > > > > MyMail.To=""

    > >
    > > > > > MyMail.TextBody = MyBody
    > > > > > MyMail.Send
    > > > > > set MyMail=nothing

    > >
    > > > > > %>
    > > > > > </HTML>

    > >
    > > > > Code looks fine (Although I would use Server.CreateObject not just
    > > > > CreateObject but I don't think would be the problem).

    > >
    > > > > Sounds like the Server Extensions Mail Options haven't been

    configured
    > > for
    > > > > the site.

    > >
    > > > > Alternative you can set the configuration fields yourself:-

    > >
    > > > > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")

    > >
    > > > > With oConfig.Fields
    > > > > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =

    2
    > > > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")

    _
    > > > > = "127.0.0.1" ' Change this to the actual server name or address
    > > > >

    ..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
    > > = 25
    > > > > .Update
    > > > > End With

    > >
    > > > > Set MyMail.Configuration = oConfig

    > >
    > > > > --
    > > > > Anthony Jones - MVP ASP/ASP.NET

    > >
    > > > I have changed the code as suggested but now get an error message
    > > > object required line 104
    > > > here is my amended script
    > > > <%
    > > > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    > > > Dim MyBody
    > > > Dim MyMail

    > >
    > > > With oConfig.Fields
    > > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
    > > > "mailhost.zen.co.uk"
    > > > .Item("http://schemas.microsoft.com/cdo/configuration/
    > > > smtpserverport") = 25
    > > > .Update
    > > > End With

    > >


    > > > Set MyMail.Configuration = oConfig


    Cut this line . . .

    > >
    > > You haven`t created MyMail yet!!
    > >
    > > I didn`t intend you to insert the code verbatim.
    > >
    > >
    > >
    > >
    > >
    > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    > > > MyBody = MyBody & "Message Time: " & now()

    > >
    > > > Set MyMail=CreateObject("CDO.Message")


    .. . . paste it here.

    > > > MyMail.Subject="Message via plasmacab.co.uk website"
    > > > MyMail.From=""
    > > > MyMail.To=""

    > >
    > > > MyMail.TextBody = MyBody
    > > > MyMail.Send
    > > > set MyMail=nothing

    > >
    > > > %>
    > > > </HTML>

    > >
    > > --
    > > Anthony Jones - MVP ASP/ASP.NET

    >
    > Then I don't know how to create mail I thought the variables were
    > being brought in from the form contact.asp a form with contact
    > details that then loads sent.asp




    --
    Anthony Jones - MVP ASP/ASP.NET
    Anthony Jones, Jan 13, 2008
    #6
  7. Guest

    On 13 Jan, 14:31, "Anthony Jones" <> wrote:
    > <> wrote in message
    >
    > news:...
    >
    > > On 12 Jan, 22:56, "Anthony Jones" <> wrote:
    > > > <> wrote in message

    >
    > > >news:...

    >
    > > > > On 12 Jan, 14:12, "Anthony Jones" <> wrote:
    > > > > > <> wrote in message

    >
    > >news:...

    >
    > > > > > > Hi
    > > > > > > I have just changed hosting companys and my mail forms I find this

    > is
    > > > > > > because new provider does not support CDONT anymore. Below is my
    > > > > > > original sent asp using CDONT and below that is my attemt to

    > recode
    > > > > > > using CDO but it does not work.

    >
    > > > > > > Can anyone plesee enter the missing lines

    >
    > > > > > > The error

    >
    > > > > > > CDO.Message.1 error '80040220'

    >
    > > > > > > The "SendUsing" configuration value is invalid.

    >
    > > > > > > /sent.asp, line 110

    >
    > > --------------------------------------------------------------------------

    >
    > > ----------------------------------------------------------------------

    >
    > > > > > > Old code taking variables from a form
    > > > > > > Dim MyBody
    > > > > > > Dim MyCDONTSMail

    >
    > > > > > > Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    > > > > > > MyCDONTSMail.From= ""
    > > > > > > MyCDONTSMail.To= ""
    > > > > > > MyCDONTSMail.Subject="Message via plasmacab.co.uk website"
    > > > > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > > > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > > > > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > > > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &

    > vbCrLf
    > > > > > > MyBody = MyBody & "Message Time: " & now()
    > > > > > > MyCDONTSMail.Body= MyBody

    >
    > > > > > > MyCDONTSMail.Send
    > > > > > > set MyCDONTSMail=nothing

    >
    > > --------------------------------------------------------------------------

    >
    > > ---------------------------------------------------------------------

    >
    > > > > > > Code I have tried to change
    > > > > > > <%
    > > > > > > Dim MyBody
    > > > > > > Dim MyMail

    >
    > > > > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > > > > MyBody = MyBody & "Email Address: " & request ("Email")&

    > vbCrLf
    > > > > > > MyBody = MyBody & "Telephone: " & request ("Telephone")&

    > vbCrLf
    > > > > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &
    > > > > > > vbCrLf
    > > > > > > MyBody = MyBody & "Message Time: " & now()

    >
    > > > > > > Set MyMail=CreateObject("CDO.Message")
    > > > > > > MyMail.Subject="Message via plasmacab.co.uk website"
    > > > > > > MyMail.From=""
    > > > > > > MyMail.To=""

    >
    > > > > > > MyMail.TextBody = MyBody
    > > > > > > MyMail.Send
    > > > > > > set MyMail=nothing

    >
    > > > > > > %>
    > > > > > > </HTML>

    >
    > > > > > Code looks fine (Although I would use Server.CreateObject not just
    > > > > > CreateObject but I don't think would be the problem).

    >
    > > > > > Sounds like the Server Extensions Mail Options haven't been

    > configured
    > > > for
    > > > > > the site.

    >
    > > > > > Alternative you can set the configuration fields yourself:-

    >
    > > > > > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")

    >
    > > > > > With oConfig.Fields
    > > > > > .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =

    > 2
    > > > > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")

    > _
    > > > > > = "127.0.0.1" ' Change this to the actual server name or address

    >
    > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
    >
    >
    >
    > > > = 25
    > > > > > .Update
    > > > > > End With

    >
    > > > > > Set MyMail.Configuration = oConfig

    >
    > > > > > --
    > > > > > Anthony Jones - MVP ASP/ASP.NET

    >
    > > > > I have changed the code as suggested but now get an error message
    > > > > object required line 104
    > > > > here is my amended script
    > > > > <%
    > > > > Dim oConfig : Set oConfig = CreateObject("CDO.Configuration")
    > > > > Dim MyBody
    > > > > Dim MyMail

    >
    > > > > With oConfig.Fields
    > > > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
    > > > > "mailhost.zen.co.uk"
    > > > > .Item("http://schemas.microsoft.com/cdo/configuration/
    > > > > smtpserverport") = 25
    > > > > .Update
    > > > > End With

    >
    > > > > Set MyMail.Configuration = oConfig

    >
    > Cut this line . . .
    >
    >
    >
    >
    >
    > > > You haven`t created MyMail yet!!

    >
    > > > I didn`t intend you to insert the code verbatim.

    >
    > > > > MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
    > > > > MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
    > > > > MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
    > > > > MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
    > > > > MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
    > > > > MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
    > > > > MyBody = MyBody & "Message Time: " & now()

    >
    > > > > Set MyMail=CreateObject("CDO.Message")

    >
    > . . . paste it here.
    >
    >
    >
    > > > > MyMail.Subject="Message via plasmacab.co.uk website"
    > > > > MyMail.From=""
    > > > > MyMail.To=""

    >
    > > > > MyMail.TextBody = MyBody
    > > > > MyMail.Send
    > > > > set MyMail=nothing

    >
    > > > > %>
    > > > > </HTML>

    >
    > > > --
    > > > Anthony Jones - MVP ASP/ASP.NET

    >
    > > Then I don't know how to create mail I thought the variables were
    > > being brought in from the form contact.asp a form with contact
    > > details that then loads sent.asp

    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET


    What a star it works fine thanks for all your help I have a lot to
    learn
    , Jan 13, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lasse Edsvik

    specify user+pwd in CDO/CDONTS

    Lasse Edsvik, Dec 12, 2003, in forum: ASP General
    Replies:
    11
    Views:
    226
    Aaron Bertrand - MVP
    Dec 15, 2003
  2. coenve

    CDO/CDONTS and truncated attachments

    coenve, Jun 3, 2004, in forum: ASP General
    Replies:
    2
    Views:
    116
    HernĂ¡n Castelo
    Jun 3, 2004
  3. Scott McNair

    CDO/CDONTS and Images

    Scott McNair, Dec 23, 2004, in forum: ASP General
    Replies:
    3
    Views:
    121
    Scott McNair
    Jan 3, 2005
  4. DigitalRick
    Replies:
    6
    Views:
    526
    Ray Costanzo [MVP]
    Jul 29, 2005
  5. Noozer

    CDO + CDONTS email routine?

    Noozer, Jul 30, 2005, in forum: ASP General
    Replies:
    1
    Views:
    126
    Egbert Nierop \(MVP for IIS\)
    Aug 2, 2005
Loading...

Share This Page