Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Email sent with ASP

Status
Not open for further replies.

hellsing

MIS
Sep 3, 2001
97
GB
I'm a real newbie with asp so forgive what is probably a stupid question.

I have an html document which calls a sendmail.asp page which sends the contents of a form from the html page in an email. It works fine, the only problem is I just get a list of the contents in one continous row, ie:

nameaddressphoneemailwebsite

What I want is:
name
address
phone
email
website

It moght be nice to have headers aswell such as:

name = name
address = blah blah
etc etc

My asp code is as follows:

' Get the form data
name = Request.Form("name")
address = Request.Form("address")
phone = Request.Form("phone")
email = Request.Form("email")
website = Request.Form("website")
subject = "Online Enquiry From Website"
recipient = "test@hellsing.com"
body = Request.Form("body")

' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.Message" )



' Set logging to true to ease any potential debugging
' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true

' Enter the sender data
msg.From = "test@hellsing.com"
msg.FromName = "This is a test"


' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
msg.AddRecipient recipient


' The subject of the message
msg.Subject = subject

' And the body
msg.body = name & address & phone & email & website & body


I'm sure someone can tell me what I'm doing wrong.

Thanks
 
add in a CR (vbCrLf) between each of the body items

Code:
msg.body = name & vbCrLf & address .......





Chris.

Indifference will be the downfall of mankind, but who cares?
 
Thanks very much.

One other question do I need to do anything different if my input fields from the form are drop down selection boxes.
Ie if "name" was a drop down selection where you can choose from Bill or Ben would it still be in the .asp as:

name = Request.Form("name")
address = Request.Form("address")
phone = Request.Form("phone")
email = Request.Form("email")
website = Request.Form("website")

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top