Having to Chabge from CDONTS to CDO can anyone help

Having to Chabge from CDONTS to CDO can anyone help

am 12.01.2008 13:26:04 von Kevin

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= "website@plasmacab.co.uk"
MyCDONTSMail.To= "enquiries@plasmacab.co.uk"
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="website@plasmacab.co.uk"
MyMail.To="enquiries@plasmacab.co.uk"

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

%>


Thanks
Kevin

Re: Having to Chabge from CDONTS to CDO can anyone help

am 12.01.2008 15:12:37 von Anthony Jones

wrote in message
news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0@k2g2000hse.googleg roups.com...
> 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= "website@plasmacab.co.uk"
> MyCDONTSMail.To= "enquiries@plasmacab.co.uk"
> 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="website@plasmacab.co.uk"
> MyMail.To="enquiries@plasmacab.co.uk"
>
> MyMail.TextBody = MyBody
> MyMail.Send
> set MyMail=nothing
>
> %>
>
>

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/sendus ing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpse rver") _
= "127.0.0.1" ' Change this to the actual server name or address
.Item("http://schemas.microsoft.com/cdo/configuration/smtpse rverport") = 25
.Update
End With

Set MyMail.Configuration = oConfig

--
Anthony Jones - MVP ASP/ASP.NET

Re: Having to Chabge from CDONTS to CDO can anyone help

am 12.01.2008 17:57:31 von Kevin

On 12 Jan, 14:12, "Anthony Jones" wrote:
> wrote in message
>
> news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0@k2g2000hse.googleg roups.com...
>
> > 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= "webs...@plasmacab.co.uk"
> > MyCDONTSMail.To= "enquir...@plasmacab.co.uk"
> > 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="webs...@plasmacab.co.uk"
> > MyMail.To="enquir...@plasmacab.co.uk"
>
> > MyMail.TextBody = MyBody
> > MyMail.Send
> > set MyMail=nothing
>
> > %>
> >
>
> 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/sendus ing") = 2
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpse rver") _
> = "127.0.0.1" ' Change this to the actual server name or address
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpse rverport") = 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/smtpse rver") =
"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="website@plasmacab.co.uk"
MyMail.To="enquiries@plasmacab.co.uk"

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

%>

Thanks

Re: Having to Chabge from CDONTS to CDO can anyone help

am 12.01.2008 23:56:08 von Anthony Jones

wrote in message
news:c86ae098-6f69-4c55-8231-994a829fe64c@k2g2000hse.googleg roups.com...
> On 12 Jan, 14:12, "Anthony Jones" wrote:
> > wrote in message
> >
> > news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0@k2g2000hse.googleg roups.com...
> >
> > > 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= "webs...@plasmacab.co.uk"
> > > MyCDONTSMail.To= "enquir...@plasmacab.co.uk"
> > > 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="webs...@plasmacab.co.uk"
> > > MyMail.To="enquir...@plasmacab.co.uk"
> >
> > > MyMail.TextBody = MyBody
> > > MyMail.Send
> > > set MyMail=nothing
> >
> > > %>
> > >
> >
> > 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/sendus ing") = 2
> > .Item("http://schemas.microsoft.com/cdo/configuration/smtpse rver") _
> > = "127.0.0.1" ' Change this to the actual server name or address
> > .Item("http://schemas.microsoft.com/cdo/configuration/smtpse rverport")
= 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/smtpse rver") =
> "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="website@plasmacab.co.uk"
> MyMail.To="enquiries@plasmacab.co.uk"
>
> MyMail.TextBody = MyBody
> MyMail.Send
> set MyMail=nothing
>
> %>
>




--
Anthony Jones - MVP ASP/ASP.NET

Re: Having to Chabge from CDONTS to CDO can anyone help

am 13.01.2008 12:17:30 von Kevin

On 12 Jan, 22:56, "Anthony Jones" wrote:
> wrote in message
>
> news:c86ae098-6f69-4c55-8231-994a829fe64c@k2g2000hse.googleg roups.com...
>
>
>
> > On 12 Jan, 14:12, "Anthony Jones" wrote:
> > > wrote in message
>
> > >news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0@k2g2000hse.google groups.com...
>
> > > > 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= "webs...@plasmacab.co.uk"
> > > > MyCDONTSMail.To= "enquir...@plasmacab.co.uk"
> > > > 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="webs...@plasmacab.co.uk"
> > > > MyMail.To="enquir...@plasmacab.co.uk"
>
> > > > MyMail.TextBody = MyBody
> > > > MyMail.Send
> > > > set MyMail=nothing
>
> > > > %>
> > > >
>
> > > 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/sendus ing") = 2
> > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpse rver") _
> > > = "127.0.0.1" ' Change this to the actual server name or address
> > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpse rverport")
> = 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/smtpse rver") =
> > "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="webs...@plasmacab.co.uk"
> > MyMail.To="enquir...@plasmacab.co.uk"
>
> > MyMail.TextBody = MyBody
> > MyMail.Send
> > set MyMail=nothing
>
> > %>
> >
>
> --
> 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

Re: Having to Chabge from CDONTS to CDO can anyone help

am 13.01.2008 15:31:06 von Anthony Jones

wrote in message
news:02022340-ba85-4ebb-aa29-d99956728421@d4g2000prg.googleg roups.com...
> On 12 Jan, 22:56, "Anthony Jones" wrote:
> > wrote in message
> >
> > news:c86ae098-6f69-4c55-8231-994a829fe64c@k2g2000hse.googleg roups.com...
> >
> >
> >
> > > On 12 Jan, 14:12, "Anthony Jones" wrote:
> > > > wrote in message
> >
> > >
>news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0@k2g2000hse.google groups.com...
> >
> > > > > 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= "webs...@plasmacab.co.uk"
> > > > > MyCDONTSMail.To= "enquir...@plasmacab.co.uk"
> > > > > 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="webs...@plasmacab.co.uk"
> > > > > MyMail.To="enquir...@plasmacab.co.uk"
> >
> > > > > MyMail.TextBody = MyBody
> > > > > MyMail.Send
> > > > > set MyMail=nothing
> >
> > > > > %>
> > > > >
> >
> > > > 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/sendus ing") =
2
> > > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpse rver")
_
> > > > = "127.0.0.1" ' Change this to the actual server name or address
> > > >
..Item("http://schemas.microsoft.com/cdo/configuration/smtps erverport")
> > = 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/smtpse rver") =
> > > "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="webs...@plasmacab.co.uk"
> > > MyMail.To="enquir...@plasmacab.co.uk"
> >
> > > MyMail.TextBody = MyBody
> > > MyMail.Send
> > > set MyMail=nothing
> >
> > > %>
> > >
> >
> > --
> > 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

Re: Having to Chabge from CDONTS to CDO can anyone help

am 13.01.2008 16:40:06 von Kevin

On 13 Jan, 14:31, "Anthony Jones" wrote:
> wrote in message
>
> news:02022340-ba85-4ebb-aa29-d99956728421@d4g2000prg.googleg roups.com...
>
> > On 12 Jan, 22:56, "Anthony Jones" wrote:
> > > wrote in message
>
> > >news:c86ae098-6f69-4c55-8231-994a829fe64c@k2g2000hse.google groups.com...
>
> > > > On 12 Jan, 14:12, "Anthony Jones" wrote:
> > > > > wrote in message
>
> >news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0@k2g2000hse.google groups.com...
>
> > > > > > 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= "webs...@plasmacab.co.uk"
> > > > > > MyCDONTSMail.To= "enquir...@plasmacab.co.uk"
> > > > > > 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="webs...@plasmacab.co.uk"
> > > > > > MyMail.To="enquir...@plasmacab.co.uk"
>
> > > > > > MyMail.TextBody = MyBody
> > > > > > MyMail.Send
> > > > > > set MyMail=nothing
>
> > > > > > %>
> > > > > >
>
> > > > > 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/sendus ing") =
> 2
> > > > > .Item("http://schemas.microsoft.com/cdo/configuration/smtpse rver")
> _
> > > > > = "127.0.0.1" ' Change this to the actual server name or address
>
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpse rverport")
>
>
>
> > > = 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/smtpse rver") =
> > > > "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="webs...@plasmacab.co.uk"
> > > > MyMail.To="enquir...@plasmacab.co.uk"
>
> > > > MyMail.TextBody = MyBody
> > > > MyMail.Send
> > > > set MyMail=nothing
>
> > > > %>
> > > >
>
> > > --
> > > 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