Having to Chabge from CDONTS to CDO can anyone help
am 12.01.2008 13:26:04 von KevinHi
I have just changed hosting companys and my mail forms I find this is
because new provider does not support CDONT anymore. Below is my
original sent asp using CDONT and below that is my attemt to recode
using CDO but it does not work.
Can anyone plesee enter the missing lines
The error
CDO.Message.1 error '80040220'
The "SendUsing" configuration value is invalid.
/sent.asp, line 110
------------------------------------------------------------ ------------------------------------------------------------ ------------------------
Old code taking variables from a form
Dim MyBody
Dim MyCDONTSMail
Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.From= "website@plasmacab.co.uk"
MyCDONTSMail.To= "enquiries@plasmacab.co.uk"
MyCDONTSMail.Subject="Message via plasmacab.co.uk website"
MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf & vbCrLf
MyBody = MyBody & "Message Time: " & now()
MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send
set MyCDONTSMail=nothing
------------------------------------------------------------ ------------------------------------------------------------ -----------------------
Code I have tried to change
<%
Dim MyBody
Dim MyMail
MyBody = MyBody & "Name: " & request ("Name")& vbCrLf
MyBody = MyBody & "Address: " & request ("Address")& vbCrLf
MyBody = MyBody & "Postcode: " & request ("Postcode")& vbCrLf
MyBody = MyBody & "Email Address: " & request ("Email")& vbCrLf
MyBody = MyBody & "Telephone: " & request ("Telephone")& vbCrLf
MyBody = MyBody & "Enquiry: " & request ("Enquiry")& vbCrLf &
vbCrLf
MyBody = MyBody & "Message Time: " & now()
Set MyMail=CreateObject("CDO.Message")
MyMail.Subject="Message via plasmacab.co.uk website"
MyMail.From="website@plasmacab.co.uk"
MyMail.To="enquiries@plasmacab.co.uk"
MyMail.TextBody = MyBody
MyMail.Send
set MyMail=nothing
%>