473,379 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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 1510
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kingdom | last post by:
I have a SelectBoxes.asp page that is working with multiple selection dropdown boxes to extract data and total the selection prices. Tom & Bob were kind enough to give me a big help getting this...
2
by: lehmann | last post by:
Hello, Is it possible to have a disabled input in a form whose value could be sent when the form is submitted. I just need the user not to be able to change the input value, but this value is...
5
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it...
3
by: StuartD | last post by:
I have developed an Access database and wish to e-mail a form to a central address advising of changes etc. Have the form and command button the form with a macro behind using SendObject command....
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
7
by: D. Patrick | last post by:
I need to duplicate the functionality of a java applet, and how it connects to a remote server. But, I don't have the protocol information or the java source code which was written years ago. ...
7
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
1
by: PrabodhanP | last post by:
I have form on my website.I am sending data entered by visitor to particular email-id through php script.Now I want to add some radio buttons and depending on selacted radio button form data should...
8
by: nargis2009 | last post by:
Hi, I have been encountering problems with my web page which is supposed to send email, and wondered if anybody can help find error. Initially I had all codes in one page and on click of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.