Forum Moderators: open

Message Too Old, No Replies

How do I email more than one form field?

strBody = Trim(Request.Form("name"))..........

         

Googly

10:04 am on Jul 17, 2003 (gmt 0)



strSubject = "Info Request"
strFromName = Trim(Request.Form("name"))
strFromEmail = Trim(Request.Form("email"))
strToEmail = "dac@bertie.com"
strBody = Trim(Request.Form("name"))

I have a form which is being sent to me via asp and cdonts.
Using this ---- strBody = Trim(Request.Form("name")) ----
I can send the 'name' field to me via the email, however there are other fields which i need sent as well, such as 'company' and 'address'. How can I add to the above code to send this info, but crucially putting the other fields on the next line of the email.

Googly

DaveN

10:17 am on Jul 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



strBody = strBody & "Customer Details" & chr(13) & chr(10)
strBody = strBody & "----------------" & chr(13) & chr(10)
strBody = strBody & "Name: " & Request("name") & chr(13) & chr(10)

Dave

Googly

10:57 am on Jul 17, 2003 (gmt 0)



Dave that it SUPERB! Thanks very much.......I'm learning all the time!

Googly

WebJoe

8:37 pm on Jul 17, 2003 (gmt 0)

10+ Year Member



If you want to make sure that all the forms fields are included in your mail body try this:

For Each strField In Request.Form
Select Case strField
Case "tbsEmail", "cmbKontakt", "tbsCc", "tbsBcc", "tbsSubject", "tbnImportance", "tbsAnswerfile" ' all fields requred for the msg header (by their name in the FORM)
strBody = strBody
Case Else
strBody = strBody & Mid(strField, 4, Len(strField)-3) & _
Space(25-Len(strField)) & ": " & Request.Form(strField) & vbCrLf
End Select
Next