sending email form data

S

socal

I'm a PHP programmer, but was asked to look at a problem with a mail
form using ASP (which I have never used before). I was able to figure
out from Googling that the error message had to do with Microsoft no
longer using CDONTS and now I can actually get it to send it to my
address. But, I'm having a problem interpreting the form data that was
setup. Here's what the person hired years ago had (basically, it's just
one text field (email) with 2 questions - 4 checkboxes each:


Dim title, Email, Checkbox1, Checkbox2, Checkbox3, Checkbox4, Checkbox5,
Checkbox6, Checkbox7, Checkbox8, infoemail, serviceemail
title = Request.Form("title")
Email = Request.Form("Email") & ""
Checkbox1 = Request.Form("Checkbox1") & ""
Checkbox2 = Request.Form("Checkbox2") & ""
Checkbox3 = Request.Form("Checkbox3") & ""
Checkbox4 = Request.Form("Checkbox4") & ""
Checkbox5 = Request.Form("Checkbox5") & ""
Checkbox6 = Request.Form("Checkbox6") & ""
Checkbox7 = Request.Form("Checkbox7") & ""
Checkbox8 = Request.Form("Checkbox8") & ""
Dim T_address
Set T_address = Server.CreateObject("ADODB.Recordset")
Set T_address.ActiveConnection = MyCNN
T_address.Source= "select infoemail, serviceemail from address"
T_address.CursorType = 1
T_address.LockType = 2
T_address.open
IF T_address.eof = false then
infoemail = T_address("infoemail")
serviceemail = Email
T_address.close
end if

Dim mymail, youremail, mail, maildesc
maildesc = ""

maildesc = maildesc & title & chr(13) & chr(13)
maildesc = maildesc & "Enter Your Email: " & Email & chr(13)
maildesc = maildesc & "Tell us if you are: " & chr(13)
if checkbox1 <> "" then
maildesc = maildesc & Checkbox1 & chr(13)
end if
if checkbox2 <> "" then
maildesc = maildesc & Checkbox2 & chr(13)
end if
if checkbox3 <> "" then
maildesc = maildesc & Checkbox3 & chr(13)
end if
if checkbox4 <> "" then
maildesc = maildesc & Checkbox4 & chr(13)
end if
maildesc = maildesc & "Select the categories you want updates on: " &
chr(13)
if checkbox5 <> "" then
maildesc = maildesc & Checkbox5 & chr(13)
end if
if checkbox6 <> "" then
maildesc = maildesc & Checkbox6 & chr(13)
end if
if checkbox7 <> "" then
maildesc = maildesc & Checkbox7 & chr(13)
end if
if checkbox8 <> "" then
maildesc = maildesc & Checkbox8 & chr(13)
end if
set Mail = createObject("CDO.Message")
Mail.Subject="Sign Me Up For A News Alert!"
Mail.From="Email"
Mail.To="(e-mail address removed)"
Mail.TextBody="maildesc"
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="mail.lausd.net"
'Server port
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
Mail.Configuration.Fields.Update
Mail.Send
set Mail=nothing
Response.redirect "complete.asp"

%>

The problem is the Mail.From and Mail.TextBody. How do I make it
interpret the data that was input?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top