Having to Chabge from CDONTS to CDO can anyone help
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 [at] plasmacab.co.uk"
MyCDONTSMail.To= "enquiries [at] 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 [at] plasmacab.co.uk"
MyMail.To="enquiries [at] plasmacab.co.uk"
MyMail.TextBody = MyBody
MyMail.Send
set MyMail=nothing
%>
</HTML>
Thanks
Kevin
Re: Having to Chabge from CDONTS to CDO can anyone help
<kevin [at] pennygate.myzen.co.uk> wrote in message
news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0 [at] 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 [at] plasmacab.co.uk"
> MyCDONTSMail.To= "enquiries [at] 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 [at] plasmacab.co.uk"
> MyMail.To="enquiries [at] plasmacab.co.uk"
>
> 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/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
On 12 Jan, 14:12, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> <ke... [at] pennygate.myzen.co.uk> wrote in message
>
> news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0 [at] 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... [at] plasmacab.co.uk"
> > MyCDONTSMail.To= "enquir... [at] 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... [at] plasmacab.co.uk"
> > MyMail.To="enquir... [at] plasmacab.co.uk"
>
> > 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/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 [at] plasmacab.co.uk"
MyMail.To="enquiries [at] plasmacab.co.uk"
MyMail.TextBody = MyBody
MyMail.Send
set MyMail=nothing
%>
</HTML>
Thanks
Re: Having to Chabge from CDONTS to CDO can anyone help
<kevin [at] pennygate.myzen.co.uk> wrote in message
news:c86ae098-6f69-4c55-8231-994a829fe64c [at] k2g2000hse.googleg roups.com...
> On 12 Jan, 14:12, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> > <ke... [at] pennygate.myzen.co.uk> wrote in message
> >
> > news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0 [at] 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... [at] plasmacab.co.uk"
> > > MyCDONTSMail.To= "enquir... [at] 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... [at] plasmacab.co.uk"
> > > MyMail.To="enquir... [at] plasmacab.co.uk"
> >
> > > 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/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 [at] plasmacab.co.uk"
> MyMail.To="enquiries [at] plasmacab.co.uk"
>
> MyMail.TextBody = MyBody
> MyMail.Send
> set MyMail=nothing
>
> %>
> </HTML>
--
Anthony Jones - MVP ASP/ASP.NET
Re: Having to Chabge from CDONTS to CDO can anyone help
On 12 Jan, 22:56, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> <ke... [at] pennygate.myzen.co.uk> wrote in message
>
> news:c86ae098-6f69-4c55-8231-994a829fe64c [at] k2g2000hse.googleg roups.com...
>
>
>
> > On 12 Jan, 14:12, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> > > <ke... [at] pennygate.myzen.co.uk> wrote in message
>
> > >news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0 [at] 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... [at] plasmacab.co.uk"
> > > > MyCDONTSMail.To= "enquir... [at] 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... [at] plasmacab.co.uk"
> > > > MyMail.To="enquir... [at] plasmacab.co.uk"
>
> > > > 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/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... [at] plasmacab.co.uk"
> > MyMail.To="enquir... [at] plasmacab.co.uk"
>
> > 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
Re: Having to Chabge from CDONTS to CDO can anyone help
<kevin [at] pennygate.myzen.co.uk> wrote in message
news:02022340-ba85-4ebb-aa29-d99956728421 [at] d4g2000prg.googleg roups.com...
> On 12 Jan, 22:56, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> > <ke... [at] pennygate.myzen.co.uk> wrote in message
> >
> > news:c86ae098-6f69-4c55-8231-994a829fe64c [at] k2g2000hse.googleg roups.com...
> >
> >
> >
> > > On 12 Jan, 14:12, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> > > > <ke... [at] pennygate.myzen.co.uk> wrote in message
> >
> > >
>news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0 [at] 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... [at] plasmacab.co.uk"
> > > > > MyCDONTSMail.To= "enquir... [at] 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... [at] plasmacab.co.uk"
> > > > > MyMail.To="enquir... [at] plasmacab.co.uk"
> >
> > > > > 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/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... [at] plasmacab.co.uk"
> > > MyMail.To="enquir... [at] plasmacab.co.uk"
> >
> > > 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
Re: Having to Chabge from CDONTS to CDO can anyone help
On 13 Jan, 14:31, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> <ke... [at] pennygate.myzen.co.uk> wrote in message
>
> news:02022340-ba85-4ebb-aa29-d99956728421 [at] d4g2000prg.googleg roups.com...
>
> > On 12 Jan, 22:56, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> > > <ke... [at] pennygate.myzen.co.uk> wrote in message
>
> > >news:c86ae098-6f69-4c55-8231-994a829fe64c [at] k2g2000hse.google groups.com...
>
> > > > On 12 Jan, 14:12, "Anthony Jones" <A... [at] yadayadayada.com> wrote:
> > > > > <ke... [at] pennygate.myzen.co.uk> wrote in message
>
> >news:99b58e6a-23dc-45f8-bb0e-95847fd63ae0 [at] 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... [at] plasmacab.co.uk"
> > > > > > MyCDONTSMail.To= "enquir... [at] 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... [at] plasmacab.co.uk"
> > > > > > MyMail.To="enquir... [at] plasmacab.co.uk"
>
> > > > > > 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/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... [at] plasmacab.co.uk"
> > > > MyMail.To="enquir... [at] plasmacab.co.uk"
>
> > > > 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