homepage Welcome to WebmasterWorld Guest from 54.204.141.129
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Website contact form help
dazz




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

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




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

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




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

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




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

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




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

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




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

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

SevenCubed




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved