Welcome to WebmasterWorld Guest from 54.160.163.163

Forum Moderators: ocean10000

Message Too Old, No Replies

Website contact form help

     

dazz

3:16 pm on Mar 4, 2013 (gmt 0)

10+ Year Member



Hi,

I wonder if anyone can help. I have many pages on my website with forms on so people can contact us with requests.

Since ive changed hosts my forms are a nightmare. I had to sort out a new sendmail.asp script which ive just about got to work but when the form gets emailed through its all merged together in a big long line with no breaks!

It looks like this -

TourOperator=&Destination=&Departure_Airport=&Accommodation_Tour=&D1=Please+Select&Date_Day=Day&Date_Month=Month&Date_Year=Year&Nights=Please+Select&Adults=2&Children=0&Child1=Select&Child2=Select&Child3=Select&Name=&Telephone=&Email=&Comments=

I really need it to look like this -

Touroperator=
Destination=
etc. So each option is on a separate line to make it readable.

On my sendmail.asp page I have the following -
objCdoMessage.TextBody = Request.form

Ive tried adding "& vbcrlf" after it but it all comes through merged still....

Any help or advise would be appriciated!

Thanks
Darren

Ocean10000

7:47 pm on Mar 4, 2013 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Just a thought.

It might be something as simple as the email being sent out as html instead of text which would ignore vbcrlf constant. You could replace "vbcrlf" with "<br>" and see if line breaks appear where you want them too.

dazz

9:59 am on Mar 5, 2013 (gmt 0)

10+ Year Member



If I change the code to -

'Add the email body text
objCdoMessage.TextBody = Request.form & "<br>"

I still get all the results squished together but with ...=&Comments=<br> at the end.

I tried the <br> without the " and it doesnt work.

Any other clues of how to break up the results!?

It really is nearly unreadable.

Thanks again

Staffa

12:43 pm on Mar 5, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Insert before :

Set objMail = Server.CreateObject("CDO.Message")

the following :

mBody = "Info sent :" & vbcrlf & vbcrlf
mBody = mBody & "TourOperator : " & Request.Form("TourOperator or whatever you called it") & vbcrlf

repeat this last line for each field in your form

replace
objCdoMessage.TextBody = Request.form
by
objCdoMessage.TextBody = mBody

dazz

3:03 pm on Mar 5, 2013 (gmt 0)

10+ Year Member



Staffa!
You are an absolute hero. You dont know how much this was doing my head in.
The forms now work a treat and easy to read...I very much appriciate your post and YOU have made my birthday which is today.
Thanks
Darren

Staffa

5:40 pm on Mar 5, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're very welcome dazz and Happy Birthday :o)

SevenCubed

5:46 pm on Mar 5, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Happy birthday dazz. I think it's kinda cool that Staffa figured out the missing &&& on post 888.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month