473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP Form Problem

Hi

can anyone help me i am new to asp and going mad, why would the
following only display the last line in the email, i.e the history
text.

thanks David Cairns

<%@ Language=VBScript %>
<%
Dim objMail
Set objMail = server.CreateObject("CDONTS.NewMail")
objMail.From = "we*****@speedster-it.com"
objMail.To = "da***@cairns.cc"
objMail.Subject = "Wanted Morgan Form"
objMail.Body = Request.Form("Name")
objMail.Body = Request.Form("Your Address")
objMail.Body = Request.Form("Post Code")
objMail.Body = Request.Form("Phone")
objMail.Body = Request.Form("Morgan/Model")
objMail.Body = Request.Form("Mile")
objMail.Body = Request.Form("spec")
objMail.Body = Request.Form("History")
objMail.BodyFormat = CdoBodyFormatHTML
objMail.MailFormat = CdoMailFormatMime
objMail.Send
set objMail=nothing
Response.Redirect "finform.htm"

%>
Jul 19 '05 #1
5 1777

"David Cairns" <da***@cairns.cc> wrote in message
news:30**************************@posting.google.c om...
Hi

can anyone help me i am new to asp and going mad, why would the
following only display the last line in the email, i.e the history
text.


Try the following...

objMail.Body = objMail.Body & Request.Form("History")
Jul 19 '05 #2

When i add that line the sendmail.asp stops working, and page cannot be
found error comes up......

any more advice would be much appreciated

cheers

David
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
"David Cairns" wrote:
: can anyone help me i am new to asp and going mad, why would the
: following only display the last line in the email, i.e the history
: text.
:
: thanks David Cairns
:
: <%@ Language=VBScript %>
: <%
: Dim objMail
: Set objMail = server.CreateObject("CDONTS.NewMail")
: objMail.From = "we*****@speedster-it.com"
: objMail.To = "da***@cairns.cc"
: objMail.Subject = "Wanted Morgan Form"
: objMail.Body = Request.Form("Name")
: objMail.Body = Request.Form("Your Address")
: objMail.Body = Request.Form("Post Code")
: objMail.Body = Request.Form("Phone")
: objMail.Body = Request.Form("Morgan/Model")
: objMail.Body = Request.Form("Mile")
: objMail.Body = Request.Form("spec")
: objMail.Body = Request.Form("History")
: objMail.BodyFormat = CdoBodyFormatHTML
: objMail.MailFormat = CdoMailFormatMime
: objMail.Send
: set objMail=nothing
: Response.Redirect "finform.htm"
:
: %>

Try changing these lines:
: objMail.Body = Request.Form("Name")
: objMail.Body = Request.Form("Your Address")
: objMail.Body = Request.Form("Post Code")
: objMail.Body = Request.Form("Phone")
: objMail.Body = Request.Form("Morgan/Model")
: objMail.Body = Request.Form("Mile")
: objMail.Body = Request.Form("spec")
: objMail.Body = Request.Form("History")

To:
dim oBody
oBody = Request.Form("Name") & vbCrLf
oBody = oBody & Request.Form("Name") & vbCrLf
oBody = oBody & Request.Form("Your Address") & vbCrLf
oBody = oBody & Request.Form("Post Code") & vbCrLf
oBody = oBody & Request.Form("Phone") & vbCrLf
oBody = oBody & Request.Form("Morgan/Model") & vbCrLf
oBody = oBody & Request.Form("Mile") & vbCrLf
oBody = oBody & Request.Form("spec") & vbCrLf
oBody = oBody & Request.Form("History") & vbCrLf
objMail.Body = oBody

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #4
Thanks so much it now all works,

but sorry to be a pain, how could i format the results so they were
displayed line by line.

thanks again

David

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5
"davidc" wrote:
: Thanks so much it now all works,
:
: but sorry to be a pain, how could i format the results so they were
: displayed line by line.

Sorry. I forgot HTML email needs HTML breaks.

dim oBody
oBody = Request.Form("Name") & "<br />" & vbCrLf
oBody = oBody & Request.Form("Name") & "<br />" & vbCrLf
oBody = oBody & Request.Form("Your Address") & "<br />" & vbCrLf
oBody = oBody & Request.Form("Post Code") & "<br />" & vbCrLf
oBody = oBody & Request.Form("Phone") & "<br />" & vbCrLf
oBody = oBody & Request.Form("Morgan/Model") & "<br />" & vbCrLf
oBody = oBody & Request.Form("Mile") & "<br />" & vbCrLf
oBody = oBody & Request.Form("spec") & "<br />" & vbCrLf
oBody = oBody & Request.Form("History") & "<br />" & vbCrLf
objMail.Body = oBody

If that doesn't work, try this:

dim oBody
oBody = Request.Form("Name") & "%0d%0a" & vbCrLf
oBody = oBody & Request.Form("Name") & "%0d%0a" & vbCrLf
oBody = oBody & Request.Form("Your Address") & "%0d%0a" & vbCrLf
oBody = oBody & Request.Form("Post Code") & "%0d%0a" & vbCrLf
oBody = oBody & Request.Form("Phone") & "%0d%0a" & vbCrLf
oBody = oBody & Request.Form("Morgan/Model") & "%0d%0a" & vbCrLf
oBody = oBody & Request.Form("Mile") & "%0d%0a" & vbCrLf
oBody = oBody & Request.Form("spec") & "%0d%0a" & vbCrLf
oBody = oBody & Request.Form("History") & "%0d%0a" & vbCrLf
objMail.Body = oBody

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Richard | last post by:
Hi, I have a form that take some time to load due to many comboboxes and at least 8 subforms. When I filter or sort the main form I get an error message and then Access shuts down. They ask if...
15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
5
by: Steve Strik | last post by:
My Problem: I have created a database here at work that is exhibiting some very strange behaviour. Essentially the database is structured in a manner where one table is a master record table...
1
by: Nico | last post by:
Hi! I use Windows XP and Access 2002 (XP) SP2 (not SP3) My company has not upgraded to SP3. My problem: -I have a form "F_BOMs" -in this form, i have a sub form called "SF_BOMs" -the sub-form...
3
by: dixie | last post by:
I have an Access 2000 form which has been running OK for a long time. Lately, it is playing up and doing things like causing Access to close suddenly when the form is opened or when saving the form...
9
by: Lyn | last post by:
Hi, I have a form which is opened from a button on another form. The form is used to display a list of records from a recordset in Continuous Mode. It is sized vertically to display about 25...
5
by: ortaias | last post by:
I have a form which calls up a second form for purposes of data entry. When closing the data entry form and returning to the main form, things don't work as expected. When I return to the main...
11
by: ChrisM | last post by:
Hi, Don't know if anyone can cast any light on this... I have a fairly complex C# WinForm with (amongst other) a text box and a button. The TextBox has events declared for KeyUp and KeyDown,...
0
by: hmm | last post by:
Hi all I have two problems: Problem #1: I'm using a .NET Form with the property 'FormBorderStyle' set to 'None'. The idea is to completely cover the area of that Form with a UserControl. In...
1
by: fugaki | last post by:
Hi everyone I'm learning asp, and i downloaded this script to teach me how to post form data from a webpage to an access database. I put it on the server so i could make sure that it worked, and...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.