S
Shona
I've managed to change the basic cdo script
(http://www.aspfaq.com/show.asp?id=2026)
and it all works fine but in my cdont's script I had some extra lines.
These lines work fine in cdon'ts
I now get an error message in my cdo script
Microsoft VBScript runtime error '800a01a8'
Object required: ''
Confirmation3.asp, line 88
This is the Cdon'ts script which does exactly what I want it to do
<%
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.To = "mymail@com"
objCDOMail.From = FP_SavedFields("Name") & "." & FP_SavedFields("Surname") &
"@com "& " <" & FP_SavedFields("Name") & "." & FP_SavedFields("Surname") &
"@com" & ">"
objCDOMail.Subject = FP_SavedFields("Results")
strBody = strBody & "Dear " & FP_SavedFields("Name") & VbCrLf
strBody = strBody & "" & FP_SavedFields("Comment") & VbCrLf
objCDOMail.Body = strBody
objCDOMail.BodyFormat = 1
objCDOMail.MailFormat = 1
objCDOMail.Send
Set objCDOMail = Nothing
%>
This is the CDO script I've tried that gives me the error message also the
mail is not received
<%
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "myserver"
.Update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "mymail@com"
.To = "mymail@com"
.Subject = "Sample CDO Message"
objCDOMail.From = FP_SavedFields("Name") & "." & FP_SavedFields("Surname")
& "@com "& " <" & FP_SavedFields("Name") & "." & FP_SavedFields("Surname")
& "@com" & ">"
objCDOMail.Subject = FP_SavedFields("Results")
strBody = strBody & "Dear " & FP_SavedFields("Name") & VbCrLf
strBody = strBody & "" & FP_SavedFields("Comment") & VbCrLf
objCDOMail.Body = strBody
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
Can anyone tell me where I'm going wrong?
Many thanks Shona
(http://www.aspfaq.com/show.asp?id=2026)
and it all works fine but in my cdont's script I had some extra lines.
These lines work fine in cdon'ts
I now get an error message in my cdo script
Microsoft VBScript runtime error '800a01a8'
Object required: ''
Confirmation3.asp, line 88
This is the Cdon'ts script which does exactly what I want it to do
<%
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.To = "mymail@com"
objCDOMail.From = FP_SavedFields("Name") & "." & FP_SavedFields("Surname") &
"@com "& " <" & FP_SavedFields("Name") & "." & FP_SavedFields("Surname") &
"@com" & ">"
objCDOMail.Subject = FP_SavedFields("Results")
strBody = strBody & "Dear " & FP_SavedFields("Name") & VbCrLf
strBody = strBody & "" & FP_SavedFields("Comment") & VbCrLf
objCDOMail.Body = strBody
objCDOMail.BodyFormat = 1
objCDOMail.MailFormat = 1
objCDOMail.Send
Set objCDOMail = Nothing
%>
This is the CDO script I've tried that gives me the error message also the
mail is not received
<%
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "myserver"
.Update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "mymail@com"
.To = "mymail@com"
.Subject = "Sample CDO Message"
objCDOMail.From = FP_SavedFields("Name") & "." & FP_SavedFields("Surname")
& "@com "& " <" & FP_SavedFields("Name") & "." & FP_SavedFields("Surname")
& "@com" & ">"
objCDOMail.Subject = FP_SavedFields("Results")
strBody = strBody & "Dear " & FP_SavedFields("Name") & VbCrLf
strBody = strBody & "" & FP_SavedFields("Comment") & VbCrLf
objCDOMail.Body = strBody
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>
Can anyone tell me where I'm going wrong?
Many thanks Shona