469,097 Members | 1,583 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,097 developers. It's quick & easy.

sending email form data

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="me@mysite.net"
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?
Apr 6 '06 #1
1 1357
You remove the quotes from around the variable
names!

"socal" <sw*****@comcast.net> wrote in message
news:Vw******************@fe06.news.easynews.com.. .
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="me@mysite.net"
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?

Apr 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by lehmann | last post: by
3 posts views Thread by StuartD | last post: by
7 posts views Thread by D. Patrick | last post: by
7 posts views Thread by bleachie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.