foxhound187 Posted February 2, 2012 Share Posted February 2, 2012 Hello, I'm having trouble formatting form data, it's picking up and sending everything correctlyhowever, apon arrival everything is blocked together, seem's to be coming in plain text format As you can see the body is one big chunk, if I try split it up the ASP crashes, and if I try declare a Body2 variablefor example, to help split it up, it crashes also. **example**There has been a request from: Daniel Test Company: LGS Job Title: Web developer Address: Test City: Sydney State: NSW PostCode: 2229 Email: dblah@blah.comsuper.com.au Phone: 9123456789 Booking Type: 1 night's twin share accommodation + Conference + Gala dinner for 2 people $580(inc GST) Diet: none 2nd person info: Bob Builder Company: LGS JobTitle: Boss man Address: Test City: Sydney State: NSW PostCode: 2229 Email: bobbossman@blah.com.au Phone: 9123456789 **here is my code** ' message subject Mail.Subject = "LGS Liaison Conference Registration" ' message body Mail.Body = "There has been a request from: " & Request.QueryString("givenName") + " " + Request.QueryString("surname") + "<br> Company: " + Request.QueryString("Company") + " Job Title: " + Request.QueryString("JobTitle") + " Address: " + Request.QueryString("Address") + " City: " + Request.QueryString("City") + " State: " + Request.QueryString("TState") + " PostCode: " + Request.QueryString("PostCode") + " Email: " + Request.QueryString("Email") + " Phone: " + Request.QueryString("PhoneNum") + " Booking Type: " + Request.QueryString("confop") + " Diet: " + Request.QueryString("Diet") Set fs = CreateObject("Scripting.FileSystemObject")Set f=fs.OpenTextFile(Server.MapPath("/eventscalendar/database/EMPconference12.txt"),8,true)f.WriteLine(Day(date()) & "/" & month(date()) & "/" & year(date()) & Request.QueryString("givenName") + "," + Request.QueryString("surname") + "," + Request.QueryString("Company") + "," + Request.QueryString("JobTitle") + "," + Request.QueryString("Address") + "," + Request.QueryString("City") + "," + Request.QueryString("TState") + "," + Request.QueryString("PostCode") + "," + Request.QueryString("Email") + "," + Request.QueryString("PhoneNum") + "," + Request.QueryString("confop") + "," + Request.QueryString("Diet") ) if Request.QueryString("confop") = "1 night's twin share accommodation + Conference + Gala dinner for 2 people $580(inc GST)" then f.WriteLine(Day(date()) & "/" & month(date()) & "/" & year(date()) & Request.QueryString("givenName2") + "," + Request.QueryString("surname2") + "," + Request.QueryString("Company2") + "," + Request.QueryString("JobTitle2") + "," + Request.QueryString("Address2") + "," + Request.QueryString("City2") + "," + Request.QueryString("TState2") + "," + Request.QueryString("PostCode2") + "," + Request.QueryString("Email2") + "," + Request.QueryString("PhoneNum2") ) Mail.Body = "There has been a request from: " & Request.QueryString("givenName") + " " + Request.QueryString("surname") + " Company: " + Request.QueryString("Company") + " Job Title: " + Request.QueryString("JobTitle") + " Address: " + Request.QueryString("Address") + " City: " + Request.QueryString("City") + " State: " + Request.QueryString("TState") + " PostCode: " + Request.QueryString("PostCode") + " Email: " + Request.QueryString("Email") + " Phone: " + Request.QueryString("PhoneNum") + " Booking Type: " + Request.QueryString("confop") + " Diet: " + Request.QueryString("Diet") + "2nd person info: " & Request.QueryString("givenName2") + " " + Request.QueryString("surname2") + " Company: " + Request.QueryString("Company2") + " JobTitle: " + Request.QueryString("JobTitle2") + " Address: " + Request.QueryString("Address2") + " City: " + Request.QueryString("City2") + " State: " + Request.QueryString("TState2") + " PostCode: " + Request.QueryString("PostCode2") + " Email: " + Request.QueryString("Email2") + " Phone: " + Request.QueryString("PhoneNum2") end if f.Closeset f=Nothingset fs=Nothing strErr = ""bSuccess = FalseOn Error Resume Next ' catch errorsMail.Send ' send message______________________________ Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted February 2, 2012 Share Posted February 2, 2012 You can use the constant VbCrLf to insert a line break wherever you want it. Link to comment Share on other sites More sharing options...
foxhound187 Posted February 2, 2012 Author Share Posted February 2, 2012 no good it seems. I've formatted the Mail body so it's a bit easier to follow. Mail.Body = "There has been a request from: " & Request.QueryString("givenName") + " " + Request.QueryString("surname") + VbCrLf _ + " Company: " + Request.QueryString("Company") + VbCrLf _ + " Job Title: " + Request.QueryString("JobTitle") + VbCrLf _ + " Address: " + Request.QueryString("Address") + VbCrLf _ + " City: " + Request.QueryString("City") + VbCrLf _ + " State: " + Request.QueryString("TState") + VbCrLf _ + " PostCode: " + Request.QueryString("PostCode") + VbCrLf _ + " Email: " + Request.QueryString("Email") + VbCrLf _ + " Phone: " + Request.QueryString("PhoneNum") + VbCrLf _ + " Booking Type: " + Request.QueryString("confop") + VbCrLf _ + " Diet: " + Request.QueryString("Diet") However it still comes out all as 1 big paragraph Link to comment Share on other sites More sharing options...
justsomeguy Posted February 2, 2012 Share Posted February 2, 2012 In VB the plus sign is for addition, the & operator is used to join strings. Link to comment Share on other sites More sharing options...
foxhound187 Posted February 3, 2012 Author Share Posted February 3, 2012 seems to be working now, didn't make any changes ???oh well I won't complain. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.