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

%>

Re: Retrieving data by Stefan

Stefan
Wed Jul 20 03:38:16 CDT 2005

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

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


"L" <L@discussions.microsoft.com> wrote in message news:D784292C-4900-4A1F-94D0-43022431CB6D@microsoft.com...
|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
|
| %>



Re: Retrieving data by L

L
Wed Jul 20 16:03:04 CDT 2005

Thanks. I will try it.

"Stefan B Rusynko" wrote:

> 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
>
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> To find the best Newsgroup for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
> _____________________________________________
>
>
> "L" <L@discussions.microsoft.com> wrote in message news:D784292C-4900-4A1F-94D0-43022431CB6D@microsoft.com...
> |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
> |
> | %>
>
>
>