Retrieving data

L

L

I have an application that I would like to send the results via email. A
user fill outs a form and based on where they live they will be sent results
for that state only. Below is the code for send the message but how do I
include the search results for their state?

Code begins:
<%

Dim strName
Dim strCompany
Dim strAddress
Dim strCity
Dim strState
Dim strZip
Dim strPhone
Dim strEmail
Dim strFax
Dim strProduct
dim strVARsite
Dim strSite
Dim strDomain

Dim objCDO
Dim objCDOResponse
Dim strResponseMessage

'Retreive the form input

strName = Request.Form("txtName")
strCompany = Request.Form("txtCompany")
strAddress = Request.Form("txtAddress")
strCity = Request.Form("txtCity")
strState = Request.Form("cboState")
strZip = Request.Form("txtZip")
strPhone = Request.Form("txtPhone")
strFax = Request.Form("txtFax")
strEmail = Request.Form("txtEmail")
strProduct = Request.Form("cboProduct")
strVARsite = "http://www.isissoftware.com"
strVARsite2 = "/ViewVARs.htm"


If Trim(strProduct) <> "" Then

'********************************************************************
'Build the message
'********************************************************************
strMessage = "I am requesting VAR Search Page Access from Isis. I have
provided my contact information as follows:" & vbCrLf & vbCrLf
strMessage = strMessage & "Name:" & vbTab & strName & vbCrLf & vbCrLf
strMessage = strMessage & "Company:" & vbTab & strCompany & vbCrLf & vbCrLf
strMessage = strMessage & "Address:" & vbTab & strAddress & vbCrLf & vbCrLf
strMessage = strMessage & "City:" & vbTab & strCity & vbCrLf & vbCrLf
strMessage = strMessage & "State:" & vbTab & strState & vbCrLf & vbCrLf
strMessage = strMessage & "Zip:" & vbTab & strZip & vbCrLf & vbCrLf
strMessage = strMessage & "Phone:" & vbTab & strPhone & vbCrLf & vbCrLf
strMessage = strMessage & "Fax:" & vbTab & strFax & vbCrLf & vbCrLf
strMessage = strMessage & "Email:" & vbTab & strEmail & vbCrLf & vbCrLf
strMessage = strMessage & "Product(s) of Interest:" & vbTab & strProduct &
vbCrLf & vbCrLf


'This is the message sent back to the requester
'strResponseMessage = "Please click on the link to search for a partner: "
& strVARsite
'strResponseMessage = strResponseMessage & strVARsite2


strSite = "varsearch"
strDomain = "isissoftware.com"

'Send the e-mail
Set objCDO = Server.CreateObject("CDONTS.NewMail")
Set objCDOResponse = Server.CreateObject("CDONTS.NewMail")

'Send to Isis
With objCDO
.To = strSite & "@" & strDomain
.From = strSite & "@" & strDomain
.Subject = "VAR Search Page Access Request "
.Body = strMessage
.Send
End With

'Send to the requester
With objCDOResponse
.To = strEMail
.From = strSite & "@" & strDomain
.Subject = "Thank you for requesting VAR Search Access information "
.Body = strResponseMessage
.Send
End With

'Destroy the objects and clean up
Set objCDO = Nothing
Set objCDOResponse = Nothing

'Send to the thank you page
Response.Redirect "ThankYou.asp"

Else

Response.Redirect "VARReqSend.asp"

End if

%>
 
S

Stefan B Rusynko

After your form field processing just open a connection to the DB based in the user criteria from the form , get the results (as a
string), and add (concatenate) it to your message: strResponseMessage




|I have an application that I would like to send the results via email. A
| user fill outs a form and based on where they live they will be sent results
| for that state only. Below is the code for send the message but how do I
| include the search results for their state?
|
| Code begins:
| <%
|
| Dim strName
| Dim strCompany
| Dim strAddress
| Dim strCity
| Dim strState
| Dim strZip
| Dim strPhone
| Dim strEmail
| Dim strFax
| Dim strProduct
| dim strVARsite
| Dim strSite
| Dim strDomain
|
| Dim objCDO
| Dim objCDOResponse
| Dim strResponseMessage
|
| 'Retreive the form input
|
| strName = Request.Form("txtName")
| strCompany = Request.Form("txtCompany")
| strAddress = Request.Form("txtAddress")
| strCity = Request.Form("txtCity")
| strState = Request.Form("cboState")
| strZip = Request.Form("txtZip")
| strPhone = Request.Form("txtPhone")
| strFax = Request.Form("txtFax")
| strEmail = Request.Form("txtEmail")
| strProduct = Request.Form("cboProduct")
| strVARsite = "http://www.isissoftware.com"
| strVARsite2 = "/ViewVARs.htm"
|
|
| If Trim(strProduct) <> "" Then
|
| '********************************************************************
| 'Build the message
| '********************************************************************
| strMessage = "I am requesting VAR Search Page Access from Isis. I have
| provided my contact information as follows:" & vbCrLf & vbCrLf
| strMessage = strMessage & "Name:" & vbTab & strName & vbCrLf & vbCrLf
| strMessage = strMessage & "Company:" & vbTab & strCompany & vbCrLf & vbCrLf
| strMessage = strMessage & "Address:" & vbTab & strAddress & vbCrLf & vbCrLf
| strMessage = strMessage & "City:" & vbTab & strCity & vbCrLf & vbCrLf
| strMessage = strMessage & "State:" & vbTab & strState & vbCrLf & vbCrLf
| strMessage = strMessage & "Zip:" & vbTab & strZip & vbCrLf & vbCrLf
| strMessage = strMessage & "Phone:" & vbTab & strPhone & vbCrLf & vbCrLf
| strMessage = strMessage & "Fax:" & vbTab & strFax & vbCrLf & vbCrLf
| strMessage = strMessage & "Email:" & vbTab & strEmail & vbCrLf & vbCrLf
| strMessage = strMessage & "Product(s) of Interest:" & vbTab & strProduct &
| vbCrLf & vbCrLf
|
|
| 'This is the message sent back to the requester
| 'strResponseMessage = "Please click on the link to search for a partner: "
| & strVARsite
| 'strResponseMessage = strResponseMessage & strVARsite2
|
|
| strSite = "varsearch"
| strDomain = "isissoftware.com"
|
| 'Send the e-mail
| Set objCDO = Server.CreateObject("CDONTS.NewMail")
| Set objCDOResponse = Server.CreateObject("CDONTS.NewMail")
|
| 'Send to Isis
| With objCDO
| .To = strSite & "@" & strDomain
| .From = strSite & "@" & strDomain
| .Subject = "VAR Search Page Access Request "
| .Body = strMessage
| .Send
| End With
|
| 'Send to the requester
| With objCDOResponse
| .To = strEMail
| .From = strSite & "@" & strDomain
| .Subject = "Thank you for requesting VAR Search Access information "
| .Body = strResponseMessage
| .Send
| End With
|
| 'Destroy the objects and clean up
| Set objCDO = Nothing
| Set objCDOResponse = Nothing
|
| 'Send to the thank you page
| Response.Redirect "ThankYou.asp"
|
| Else
|
| Response.Redirect "VARReqSend.asp"
|
| End if
|
| %>
 
L

L

Thanks. I will try it.

Stefan B Rusynko said:
After your form field processing just open a connection to the DB based in the user criteria from the form , get the results (as a
string), and add (concatenate) it to your message: strResponseMessage




|I have an application that I would like to send the results via email. A
| user fill outs a form and based on where they live they will be sent results
| for that state only. Below is the code for send the message but how do I
| include the search results for their state?
|
| Code begins:
| <%
|
| Dim strName
| Dim strCompany
| Dim strAddress
| Dim strCity
| Dim strState
| Dim strZip
| Dim strPhone
| Dim strEmail
| Dim strFax
| Dim strProduct
| dim strVARsite
| Dim strSite
| Dim strDomain
|
| Dim objCDO
| Dim objCDOResponse
| Dim strResponseMessage
|
| 'Retreive the form input
|
| strName = Request.Form("txtName")
| strCompany = Request.Form("txtCompany")
| strAddress = Request.Form("txtAddress")
| strCity = Request.Form("txtCity")
| strState = Request.Form("cboState")
| strZip = Request.Form("txtZip")
| strPhone = Request.Form("txtPhone")
| strFax = Request.Form("txtFax")
| strEmail = Request.Form("txtEmail")
| strProduct = Request.Form("cboProduct")
| strVARsite = "http://www.isissoftware.com"
| strVARsite2 = "/ViewVARs.htm"
|
|
| If Trim(strProduct) <> "" Then
|
| '********************************************************************
| 'Build the message
| '********************************************************************
| strMessage = "I am requesting VAR Search Page Access from Isis. I have
| provided my contact information as follows:" & vbCrLf & vbCrLf
| strMessage = strMessage & "Name:" & vbTab & strName & vbCrLf & vbCrLf
| strMessage = strMessage & "Company:" & vbTab & strCompany & vbCrLf & vbCrLf
| strMessage = strMessage & "Address:" & vbTab & strAddress & vbCrLf & vbCrLf
| strMessage = strMessage & "City:" & vbTab & strCity & vbCrLf & vbCrLf
| strMessage = strMessage & "State:" & vbTab & strState & vbCrLf & vbCrLf
| strMessage = strMessage & "Zip:" & vbTab & strZip & vbCrLf & vbCrLf
| strMessage = strMessage & "Phone:" & vbTab & strPhone & vbCrLf & vbCrLf
| strMessage = strMessage & "Fax:" & vbTab & strFax & vbCrLf & vbCrLf
| strMessage = strMessage & "Email:" & vbTab & strEmail & vbCrLf & vbCrLf
| strMessage = strMessage & "Product(s) of Interest:" & vbTab & strProduct &
| vbCrLf & vbCrLf
|
|
| 'This is the message sent back to the requester
| 'strResponseMessage = "Please click on the link to search for a partner: "
| & strVARsite
| 'strResponseMessage = strResponseMessage & strVARsite2
|
|
| strSite = "varsearch"
| strDomain = "isissoftware.com"
|
| 'Send the e-mail
| Set objCDO = Server.CreateObject("CDONTS.NewMail")
| Set objCDOResponse = Server.CreateObject("CDONTS.NewMail")
|
| 'Send to Isis
| With objCDO
| .To = strSite & "@" & strDomain
| .From = strSite & "@" & strDomain
| .Subject = "VAR Search Page Access Request "
| .Body = strMessage
| .Send
| End With
|
| 'Send to the requester
| With objCDOResponse
| .To = strEMail
| .From = strSite & "@" & strDomain
| .Subject = "Thank you for requesting VAR Search Access information "
| .Body = strResponseMessage
| .Send
| End With
|
| 'Destroy the objects and clean up
| Set objCDO = Nothing
| Set objCDOResponse = Nothing
|
| 'Send to the thank you page
| Response.Redirect "ThankYou.asp"
|
| Else
|
| Response.Redirect "VARReqSend.asp"
|
| End if
|
| %>
 

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

Top