473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Help w/ syntax to have body of email include form fields

Hello,

I finally figured out how to get my form to its database and have an
email come my way. However I am now trying to set up the body of the
email to include the form details. However the body of the email that
is sent only includes the last line of the "body" tag and has no
details next to it.

The email sent shows up with this in its body:

Request Date:
AND NOTHING ELSE.
The script/code I am using is:

<%
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "New Form"
objMessage.Sender = "Intranet"
objMessage.To = "justine.nar...@egseg.com"
objMessage.TextBody="An IT Employee Status Change form has been filled
out. Please see the information below: " & VbCrLf
objMessage.TextBody="Employee Name: " & Request.Form("EmployeeName") &
VbCrLf
objMessage.TextBody="Pay Number: " & Request.Form("PayNumber") & VbCrLF

objMessage.TextBody="Requested By: " & Request.Form("RequestedBy") &
VbCrLF
objMessage.TextBody="Request Date: " & Request.Form("RequestDate")
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")

= 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")

= "155.116.12.19"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")

= 25
objMessage.Configuration.Fields.Update
objMessage.Send
%>

I am trying to get the body of the email to look like this:

An IT Employee Status Change form has been filled out. Please see the
information below:

Employee Name: Someones Name
Pay Number: XX333
Requested By: Someones Name
Request Date: mm/dd/yy
All the above fields are the fields to my form that users will be
filling out.

Any help would be greatly appreciated.

Thanks,
Justine

Mar 22 '06 #1
2 4028
This is happening because every time you are assigning a value to the
..TextBody property of your mail object, it's overwriting the previous value.
It's like doing:

Dim x
x = "a"
x = "b"
x = "c"
x = "d"
Response.Write x

What will you get? abcd or d? The answer is d.

Try:

Dim sBody

sBody = = "An IT Employee Status Change form has been filled out. Please see
the information below: " & VbCrLf
sBody = sBody & "Employee Name: " & Request.Form("EmployeeName") & VbCrLf
sBody = sBody & "Pay Number: " & Request.Form("PayNumber") & VbCrLF
sBody = sBody & "Requested By: " & Request.Form("RequestedBy") & VbCrLF
sBody = sBody & "Request Date: " & Request.Form("RequestDate")

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "New Form"
objMessage.Sender = "Intranet"
objMessage.To = "justine.nar...@egseg.com"
objMessage.Textbody = sBody
''etc.

Ray at home

<JN*****@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
Hello,

I finally figured out how to get my form to its database and have an
email come my way. However I am now trying to set up the body of the
email to include the form details. However the body of the email that
is sent only includes the last line of the "body" tag and has no
details next to it.

The email sent shows up with this in its body:

Request Date:


Mar 22 '06 #2
This is exactly what I needed and I thanks for the reasoning behind it,
too. I will try it out and see what happens.

- Justine

Mar 22 '06 #3

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

Similar topics

6
by: dmiller23462 | last post by:
Here is the code, it's not complete of course....I've been inserting lines as I go to pinpoint the issue.....I understand that the error message I'm getting (#185 Missing Default Property) is...
7
by: Mike | last post by:
I've been trying for the past week to put a simple code together. I have done a LOT of searching, found scripts showing the functions I would like to use, however when I mix them it all goes wrong,...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Jeff | last post by:
I am getting Unable to find operator in query string. Query string currently is INSERT INTO Results (Name,Email,Comments,File) VALUES ('::Name::','::Email::','::Comments::','::File::') Here...
9
by: isaac2004 | last post by:
hi i have a page that inclued a SQL statement that takes a user input from a form and displays the request from the database. every time i try to open the page i get an error message that says Data...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
1
by: nth | last post by:
I wan to filter the database show out information by using the user login name. Means that when that user login by entering their names n password, if correct then it will go to the other page by...
1
by: valmae | last post by:
Please help anyone! I am getting this error after the submit button is clicked to this form which was designed in Dreamweaver in ASP. Microsoft VBScript compilation error '800a0401' Expected...
3
by: ibeehbk | last post by:
Hi. I have a form made in xhtml. I test via vbscript to make sure none of the fields are empty and properly formatted (ie email). All the regular fields work. However, I have two drop down menus...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.