Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Having to Chabge from CDONTS to CDO can anyone help

Reply
Thread Tools

Having to Chabge from CDONTS to CDO can anyone help

 
 
kevin@pennygate.myzen.co.uk
Guest
Posts: n/a
 
      01-12-2008
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= "(E-Mail Removed)"
MyCDONTSMail.To= "(E-Mail Removed)"
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="(E-Mail Removed)"
MyMail.To="(E-Mail Removed)"

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

%>
</HTML>

Thanks
Kevin

 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      01-12-2008

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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= "(E-Mail Removed)"
> MyCDONTSMail.To= "(E-Mail Removed)"
> 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="(E-Mail Removed)"
> MyMail.To="(E-Mail Removed)"
>
> 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


 
Reply With Quote
 
 
 
 
kevin@pennygate.myzen.co.uk
Guest
Posts: n/a
 
      01-12-2008
On 12 Jan, 14:12, "Anthony Jones" <(E-Mail Removed)> wrote:
> <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
> > 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= "(E-Mail Removed)"
> > MyCDONTSMail.To= "(E-Mail Removed)"
> > 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="(E-Mail Removed)"
> > MyMail.To="(E-Mail Removed)"

>
> > 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="(E-Mail Removed)"
MyMail.To="(E-Mail Removed)"

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

%>
</HTML>
Thanks
 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      01-12-2008
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 12 Jan, 14:12, "Anthony Jones" <(E-Mail Removed)> wrote:
> > <(E-Mail Removed)> wrote in message
> >
> > news:(E-Mail Removed)...
> >
> > > 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= "(E-Mail Removed)"
> > > MyCDONTSMail.To= "(E-Mail Removed)"
> > > 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="(E-Mail Removed)"
> > > MyMail.To="(E-Mail Removed)"

> >
> > > 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="(E-Mail Removed)"
> MyMail.To="(E-Mail Removed)"
>
> MyMail.TextBody = MyBody
> MyMail.Send
> set MyMail=nothing
>
> %>
> </HTML>





--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
kevin@pennygate.myzen.co.uk
Guest
Posts: n/a
 
      01-13-2008
On 12 Jan, 22:56, "Anthony Jones" <(E-Mail Removed)> wrote:
> <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > On 12 Jan, 14:12, "Anthony Jones" <(E-Mail Removed)> wrote:
> > > <(E-Mail Removed)> wrote in message

>
> > >news:(E-Mail Removed)...

>
> > > > 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= "(E-Mail Removed)"
> > > > MyCDONTSMail.To= "(E-Mail Removed)"
> > > > 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="(E-Mail Removed)"
> > > > MyMail.To="(E-Mail Removed)"

>
> > > > 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="(E-Mail Removed)"
> > MyMail.To="(E-Mail Removed)"

>
> > 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
 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      01-13-2008


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 12 Jan, 22:56, "Anthony Jones" <(E-Mail Removed)> wrote:
> > <(E-Mail Removed)> wrote in message
> >
> > news:(E-Mail Removed)...
> >
> >
> >
> > > On 12 Jan, 14:12, "Anthony Jones" <(E-Mail Removed)> wrote:
> > > > <(E-Mail Removed)> wrote in message

> >
> > >

>news:(E-Mail Removed)...
> >
> > > > > 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= "(E-Mail Removed)"
> > > > > MyCDONTSMail.To= "(E-Mail Removed)"
> > > > > 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="(E-Mail Removed)"
> > > > > MyMail.To="(E-Mail Removed)"

> >
> > > > > 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="(E-Mail Removed)"
> > > MyMail.To="(E-Mail Removed)"

> >
> > > 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


 
Reply With Quote
 
kevin@pennygate.myzen.co.uk
Guest
Posts: n/a
 
      01-13-2008
On 13 Jan, 14:31, "Anthony Jones" <(E-Mail Removed)> wrote:
> <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
> > On 12 Jan, 22:56, "Anthony Jones" <(E-Mail Removed)> wrote:
> > > <(E-Mail Removed)> wrote in message

>
> > >news:(E-Mail Removed)...

>
> > > > On 12 Jan, 14:12, "Anthony Jones" <(E-Mail Removed)> wrote:
> > > > > <(E-Mail Removed)> wrote in message

>
> >news:(E-Mail Removed)...

>
> > > > > > 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= "(E-Mail Removed)"
> > > > > > MyCDONTSMail.To= "(E-Mail Removed)"
> > > > > > 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="(E-Mail Removed)"
> > > > > > MyMail.To="(E-Mail Removed)"

>
> > > > > > 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="(E-Mail Removed)"
> > > > MyMail.To="(E-Mail Removed)"

>
> > > > 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CDO + CDONTS email routine? Noozer ASP General 1 08-02-2005 07:51 AM
Converting CDONTS to CDO to send mail from a guestbook to me.... DigitalRick ASP General 6 07-29-2005 06:39 PM
CDO/CDONTS and Images Scott McNair ASP General 3 01-03-2005 08:31 PM
CDO/CDONTS and truncated attachments coenve ASP General 2 06-03-2004 07:37 PM
specify user+pwd in CDO/CDONTS Lasse Edsvik ASP General 11 12-15-2003 02:10 PM



Advertisments