Click to See Complete Forum and Search --> : submit form results to email addy


chrismartz
09-12-2004, 02:16 PM
I have the following form that works but never sends the form results....<%
Dim objDC, rs, id,
id = Request.Querystring("id")

' Create and establish data connection
Set objDC = Server.CreateObject("ADODB.Connection")
objDC.ConnectionTimeout = 15
objDC.CommandTimeout = 30

'Use this line to use Access
objDC.Open "DBQ=" & Server.MapPath("../../db/zytre04.mdb") &

";Driver={Microsoft Access Driver

(*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password"

' Create recordset and retrieve values using the open connection

Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "SELECT * FROM homework WHERE id = "& id , objDC, 3
Set objEMail = Server.CreateObject("CDO.Message")

Set objConfig = Server.CreateObject("CDO.Configuration")
Set Confi = objConfig.Fields
Confi("http://schemas.microsoft.com/cdo/configuration/sendusing") =

1
Confi("http://schemas.microsoft.com/cdo/configuration/smtpserverpick

updirectory") = "C:\inetpub\mailroot\pickup"
Confi.Update
Set objEMail.Configuration = objConfig
objEMail.To = "email@email.com"
objEMail.From = Request.Form("email")
objEMail.Subject = "Error Report on WCHS Site"
objEMail.TextBody = Request.Form("name")
objEMail.TextBody = Request.Form("message")
objEMail.Send
Set objEMail = Nothing
Response.Redirect("teacherhome.asp?id="&id)
%>How can I get the results to send?

lmf232s
09-14-2004, 01:54 PM
instead of this

objEMail.TextBody = Request.Form("name")
objEMail.TextBody = Request.Form("message")


Try something like this

Dim body
body = Request.Form("name") & "<BR>"
body = body & request.Form("message")

objEMail.TextBody = body

not sure if that will help or not.