I have a script below which will send an email upon submiting. I want my to field to come from a database. Here is what I have right now objCDO.To = rs.field("supervisorsemail"
.value. I get the following error message.
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'rs.field'
/am1st/MyStuff/time.asp, line 76
Can you help?
if Request.Form("FFSubmitted"
= "yes" then
FormFields = ""
If FormFields <> "" Then
arrFormFields = split(FormFields,"~"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
End If
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.From = "timesheet@am1st.com"
objCDO.To = rs.field("supervisorsemail"
.value
objCDO.Cc = ""
objCDO.Bcc = ""
objCDO.Subject = "Please Approve this time"
BodyString = Replace("","~",chr(13) & chr(10) )& chr(13)
If FormFields <> "" Then
For Each item In arrFormFields
BodyString = BodyString & item & ": " & Request.Form(item) & chr(13)
Next
End If
objCDO.Body = BodyString
objCDO.BodyFormat = 1
objCDO.MailFormat = 1
objCDO.Send
Set objCDO = Nothing
RedirectURL = ""
If RedirectURL <> "" then
If Request.QueryString <> "" Then
response.redirect(RedirectURL & "?" & Request.QueryString)
else
response.redirect(RedirectURL)
end If
end if
end if
%>
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'rs.field'
/am1st/MyStuff/time.asp, line 76
Can you help?
if Request.Form("FFSubmitted"
FormFields = ""
If FormFields <> "" Then
arrFormFields = split(FormFields,"~"
End If
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.From = "timesheet@am1st.com"
objCDO.To = rs.field("supervisorsemail"
objCDO.Cc = ""
objCDO.Bcc = ""
objCDO.Subject = "Please Approve this time"
BodyString = Replace("","~",chr(13) & chr(10) )& chr(13)
If FormFields <> "" Then
For Each item In arrFormFields
BodyString = BodyString & item & ": " & Request.Form(item) & chr(13)
Next
End If
objCDO.Body = BodyString
objCDO.BodyFormat = 1
objCDO.MailFormat = 1
objCDO.Send
Set objCDO = Nothing
RedirectURL = ""
If RedirectURL <> "" then
If Request.QueryString <> "" Then
response.redirect(RedirectURL & "?" & Request.QueryString)
else
response.redirect(RedirectURL)
end If
end if
end if
%>