473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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= "we*****@plasmacab.co.uk"
MyCDONTSMail.To= "en*******@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="we*****@plasmacab.co.uk"
MyMail.To="en*******@plasmacab.co.uk"

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

%>
</HTML>

Thanks
Kevin

Jan 12 '08 #1
6 1897

<ke***@pennygate.myzen.co.ukwrote in message
news:99**********************************@k2g2000h se.googlegroups.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= "we*****@plasmacab.co.uk"
MyCDONTSMail.To= "en*******@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="we*****@plasmacab.co.uk"
MyMail.To="en*******@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/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
Jan 12 '08 #2
On 12 Jan, 14:12, "Anthony Jones" <A...@yadayadayada.comwrote:
<ke...@pennygate.myzen.co.ukwrote in message

news:99**********************************@k2g2000h se.googlegroups.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
%>
</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="we*****@plasmacab.co.uk"
MyMail.To="en*******@plasmacab.co.uk"

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

%>
</HTML>
Thanks
Jan 12 '08 #3
<ke***@pennygate.myzen.co.ukwrote in message
news:c8**********************************@k2g2000h se.googlegroups.com...
On 12 Jan, 14:12, "Anthony Jones" <A...@yadayadayada.comwrote:
<ke...@pennygate.myzen.co.ukwrote in message

news:99**********************************@k2g2000h se.googlegroups.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
%>
</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="we*****@plasmacab.co.uk"
MyMail.To="en*******@plasmacab.co.uk"

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

%>
</HTML>

--
Anthony Jones - MVP ASP/ASP.NET
Jan 12 '08 #4
On 12 Jan, 22:56, "Anthony Jones" <A...@yadayadayada.comwrote:
<ke...@pennygate.myzen.co.ukwrote in message

news:c8**********************************@k2g2000h se.googlegroups.com...
On 12 Jan, 14:12, "Anthony Jones" <A...@yadayadayada.comwrote:
<ke...@pennygate.myzen.co.ukwrote in message
>news:99**********************************@k2g2000 hse.googlegroups.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
%>
</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="webs...@plasmacab.co.uk"
MyMail.To="enquir...@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
Jan 13 '08 #5


<ke***@pennygate.myzen.co.ukwrote in message
news:02**********************************@d4g2000p rg.googlegroups.com...
On 12 Jan, 22:56, "Anthony Jones" <A...@yadayadayada.comwrote:
<ke...@pennygate.myzen.co.ukwrote in message

news:c8**********************************@k2g2000h se.googlegroups.com...
On 12 Jan, 14:12, "Anthony Jones" <A...@yadayadayada.comwrote:
<ke...@pennygate.myzen.co.ukwrote in message
>
news:99**********************************@k2g2000 hse.googlegroups.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
%>
</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="webs...@plasmacab.co.uk"
MyMail.To="enquir...@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
Jan 13 '08 #6
On 13 Jan, 14:31, "Anthony Jones" <A...@yadayadayada.comwrote:
<ke...@pennygate.myzen.co.ukwrote in message

news:02**********************************@d4g2000p rg.googlegroups.com...
On 12 Jan, 22:56, "Anthony Jones" <A...@yadayadayada.comwrote:
<ke...@pennygate.myzen.co.ukwrote in message
>news:c8**********************************@k2g2000 hse.googlegroups.com...
On 12 Jan, 14:12, "Anthony Jones" <A...@yadayadayada.comwrote:
<ke...@pennygate.myzen.co.ukwrote in message
news:99**********************************@k2g2000h se.googlegroups.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
%>
</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="webs...@plasmacab.co.uk"
MyMail.To="enquir...@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
Jan 13 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: | last post by:
Hi Guys CDONTS works with all sites hosted on my test server bar one (which surely rules out a miscomputation of the Default SMTP server in IIS). I have tried uploading the file with make up...
4
by: Steve | last post by:
Hi all, I'm using IIS 5 on a win xp machine for all my testing, before I upload to our live server. I've installed the SMTP service and it's running with no errors. Dose anyone know anything...
4
by: Alistair | last post by:
can anyone see why this wouldn't work...it's driving me nuts Set objcdmail = Server.CreateObject("CDONTS.NewMail") objcdmail.From = "me@mydomain.com" objcdmail.To = "me@mydomain.com"...
1
by: Tom Fuchs | last post by:
We have been using CDONTS with IIS 5.0-Win2K for more than a year now without any problems. Recently our exchange server ran into some problems and the information store needed to be rebuilt. ...
2
by: Paul Turley | last post by:
Does anyone have some sample code for sending an HTML formatted message using CDONTS? Thanks RE: Sending HTML formatted mail using CDONTS -- Paul Turley, MCSD, MCAD, MCT, MSF...
3
by: Ammar | last post by:
Hi All! I have been trying to use ASP to send E-mail from a web page using CDONTS; I tried first to run the asp file in my computer (I am running IIS under Windows XP-Pro) but nothing happened,...
3
by: Hugo Lefebvre | last post by:
Is there a maximum number of emails CDONTS can handle in an asp script? I have different questions about this. Question1: example1: set objSendMail = createobject("CDONTS.NewMail") ...... ...
7
by: Paul | last post by:
I have just started work on a system using CDONTS to mail out. Whilst this is fine on the server, my local development machine is using XP Pro with IIS5.1 installed. Is there a way I can get the...
0
by: jbguernsey | last post by:
I am hoping to be able to avoid the Outlook security problem by using CDONTS and I tried using the code below (with appropriate change to the address etc): Dim oEMail As New CDONTS.EMail ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.