dgrow
asked on
FrontPage Form on a Domain - HELP
I am running a simple webpage created in FP to request information from a user. This webpage is internal to my domain only. I would like to automatically see who they are logged in as (login name) and add that to a field in the form. This webserver is on a 2000 server running Active directory. User's don't have to log into this page as they are already authenticated. Is there any way to capture this info?'
DG
DG
ASKER
RCMB:
Thanks for the info. We are going to be using an e-mail response from the form to an exchange mailbox. I am assuming I can set the value for a field and have it result out of the form to the e-mail. Correct?
DG
Thanks for the info. We are going to be using an e-mail response from the form to an exchange mailbox. I am assuming I can set the value for a field and have it result out of the form to the e-mail. Correct?
DG
ASKER
Having problems getting this functon to work. Won't display page.
DG
DG
No you are not quite correct. Sending the email is a little different as FrontPage send email will not work with an ASP page. You will need to use something like CDONTS to send the email. Since this is internal and you control the environment I will post you a solution here. Give me a little bit to gather the code.
RCMB
RCMB
Okay here is what you need to do
Create a new page and save it as sendmsg.asp
Put this code in your sendmsg.asp file before the <head> tag
Edit the information required
<%
' Send by connecting to port 25 of the SMTP server.
'Email address of the person receiving the email
strEmail = "" & request("emailaddress") & ""
strSubject = "PUT YOUR EMAIL SUBJECT HERE"
Const cdoSendUsingPort = 2
set iMsg = CreateObject("CDO.Message" )
set iConf = CreateObject("CDO.Configur ation")
Set Flds = iConf.Fields
' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
'Replace 0.0.0.0 with the IP address of your email server
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "0.0.0.0"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = strEmail
.From = "Webmaster@yourdomain.com"
.Subject = strSubject
.HTMLBody = "Put your email body here"
.Send
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
%>
Save your file
Open the file that contains your form, right click inside the form and select form properties and options. Change the destination of the form to sendmsg.asp
Now save that page and test it.
You can add a response.redirect to the end of your sendmsg.asp page to have the page redirect to another file after it sends the message or you can make it display a note like -- Thanks for your submission. You will be receiving an email with the information you have submitted. Please click here to return to the home page.
Let me know if you need more help.
RCMB
Create a new page and save it as sendmsg.asp
Put this code in your sendmsg.asp file before the <head> tag
Edit the information required
<%
' Send by connecting to port 25 of the SMTP server.
'Email address of the person receiving the email
strEmail = "" & request("emailaddress") & ""
strSubject = "PUT YOUR EMAIL SUBJECT HERE"
Const cdoSendUsingPort = 2
set iMsg = CreateObject("CDO.Message"
set iConf = CreateObject("CDO.Configur
Set Flds = iConf.Fields
' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
'Replace 0.0.0.0 with the IP address of your email server
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "0.0.0.0"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = strEmail
.From = "Webmaster@yourdomain.com"
.Subject = strSubject
.HTMLBody = "Put your email body here"
.Send
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
%>
Save your file
Open the file that contains your form, right click inside the form and select form properties and options. Change the destination of the form to sendmsg.asp
Now save that page and test it.
You can add a response.redirect to the end of your sendmsg.asp page to have the page redirect to another file after it sends the message or you can make it display a note like -- Thanks for your submission. You will be receiving an email with the information you have submitted. Please click here to return to the home page.
Let me know if you need more help.
RCMB
ASKER
Thanks! The e-mail portion worked great. I can see I need to brush up on my html. The last problem I have is that I need to information from the form to be sent in the e-mail. I must be missing something.
DG
DG
.HTMLBody = "Put your email body here"
You can replace the info between the "" with your information.
The base way to capture all of this is to use request.form("FieldName") and assign them to variables.
Somelike:
varMsg = request.form("MessageBody" )
.HTMLBody = varMsg
This way you can use anything being sent by the form and put it whereever you need it.
RCMB
You can replace the info between the "" with your information.
The base way to capture all of this is to use request.form("FieldName") and assign them to variables.
Somelike:
varMsg = request.form("MessageBody"
.HTMLBody = varMsg
This way you can use anything being sent by the form and put it whereever you need it.
RCMB
ASKER
Thanks. I had done the above already.
I would like to send a formatted message that has all the form information in the message and is nice looking. I assume there is a way to create an html text file with the proper formatting and variable names from the form and have that sent as the body. In using the straight .htmlbody = command, how would I get all 18 fields values with labels (e.g. Potential Client Name: <%=request.form("Potential _Client_Na me")%>) into a nice looking e-mail with blank lines, horizontal line separators, etc into the message. I assume a file that is preformatted with the nice looking html code and the appropriate variable names is possible.
Thanks again for your patience and help. You've opened my eyes quite a bit and made me realize it's time to get a book.
DG
I would like to send a formatted message that has all the form information in the message and is nice looking. I assume there is a way to create an html text file with the proper formatting and variable names from the form and have that sent as the body. In using the straight .htmlbody = command, how would I get all 18 fields values with labels (e.g. Potential Client Name: <%=request.form("Potential
Thanks again for your patience and help. You've opened my eyes quite a bit and made me realize it's time to get a book.
DG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to help.
RCMB
RCMB
ASKER
Thanks. I figured it out. I did it a similiar way. I created the HTML file to look exactly like I wanted it and put unique placemarkers on the page (@@@client@@@). I save the html file as a text file. Part of the routine is to assign all the request.form(variable) to variables. I have a routine that uses readall to read the file and assign to BodyText. I used the replace command to replace the variable for the place marker for each field. Kind of kludgy, but works!
Thanks again for your help.
DG
Thanks again for your help.
DG
ASKER
RCMB -
I'm 99.9% there. The only issue I have now is that the boxes that are textboxes. I'll enter text on several lines (done by hitting return in the textbox).
For example, in the comments textbox:
<textarea rows="2" name="Comments" cols="55" style="font-family: Arial; font-size: 12pt" wrap="hard"></textarea>
I enter the following information:
Line 1
Line 2
Line 3
When I use the Comments=request.form("Com ments") command in the sendmsg.asp, the return I get is:
Line 1 Line 2 Line 3. It doesn't retain the hardreturns
As you can see, I've used the wrap="hard" (as well as wrap=hard". I've also tried the <PRE></PRE> command that I found in another post. I also found one post that said to use the replace command Comments= Replace(Comments, "<BR>", vbCrLf) as suggested. It all keeps coming across as one line.
Thanks in advance for all your help
DG
I'm 99.9% there. The only issue I have now is that the boxes that are textboxes. I'll enter text on several lines (done by hitting return in the textbox).
For example, in the comments textbox:
<textarea rows="2" name="Comments" cols="55" style="font-family: Arial; font-size: 12pt" wrap="hard"></textarea>
I enter the following information:
Line 1
Line 2
Line 3
When I use the Comments=request.form("Com
Line 1 Line 2 Line 3. It doesn't retain the hardreturns
As you can see, I've used the wrap="hard" (as well as wrap=hard". I've also tried the <PRE></PRE> command that I found in another post. I also found one post that said to use the replace command Comments= Replace(Comments, "<BR>", vbCrLf) as suggested. It all keeps coming across as one line.
Thanks in advance for all your help
DG
Use this code to edit your variable
varInfo = request.form("Info")
If ISNULL(varInfo) Then
varInfo = varInfo
Else
varInfo = replace(varInfo,vbcrlf,"<B R>")
End if
RCMB
varInfo = request.form("Info")
If ISNULL(varInfo) Then
varInfo = varInfo
Else
varInfo = replace(varInfo,vbcrlf,"<B
End if
RCMB
ASKER
You truly ARE an expert!
Thanks again!
DG
Thanks again!
DG
Then the page must be an ASP page and you need to insert this code:
<%
Function getLoginUser()
Dim strCurUserID, arrCurUserID
strCurUserID = REPLACE(request.ServerVari
arrCurUserID = Split(strCurUserID,"/")
getLoginUser = arrCurUserID(ubound(arrCur
End function
%>
Put this inside your form tags
<input type=hidden name=username value=<%=getLoginUser%>>
Now when you write to the database or whaterver
INSERT INTO Table (UserName) Values ('::username::')
RCMB