I have an html web form when data is entered into this form by a user the information retrieved from the form is sent to me via email using an ASP form mail.
Now my question is i want the content of the email to be formated so that is can be easier to read how do i go about this.
Below is the form mailer
What i am looking to achive is put in some bold and colors.
<%@ Language=VBScript %>
<% Option Explicit %>
'The header/footer for the email.
Const strHeader = "Here are the results of the form:"
Const strFooter = "Custumer Request Form "
'email will be going to
Const strTo = "firstname.lastname@example.org"
'This information is optional
Dim strFrom, strSubject, strRedirectURL, strFromPath
'strFrom = Request.Form("txtSendToEma
strFrom = " Request for new acct "
if Len(strFrom) = 0 then strFrom = strTo
'strSubject = Request.Form("txtEmailSubj
strSubject = " A new request has been made "
if Len(strSubject) = 0 then strSubject = ""
strRedirectURL = "http://www.dilys.com/Sales/htm/thanks.htm
if Len(strRedirectURL) = 0 then strRedirectURL = "/"
'strFromPath = Request.Form("urlFromPath"
'if Len(strFromPath) = 0 then strFromPath = "UNKNOWN"
strBody = strHeader & ( vbCrLf & vbCrLf )
strBody = strBody & ( "Customer request form information: " & strFromPath & vbCrLf ) & _
( "FORM submitted at " & Now() & vbCrLf & vbCrLf )
dim ix, formElementName, formElementValue, prefix, fldName
For ix = 1 to Request.Form.Count
formElementName = Request.Form.Key(ix)
formElementValue = Request.Form.Item(ix)
' what type of field was that on the form?
prefix = Left(formElementName,3)
' and throw away prefix to get actual field name
fldName = Mid(formElementName,4)
' but change periods to spaces for readability
fldName = Replace(fldName, "."," ")
Select Case prefix
' if the prefix indicates this is a form field of interest...
' if user didn't answer this question, say so...
if Len(formElementValue) = 0 then formElementValue = "unansewered"
' then tack on the name of the field and the answer
strBody = strBody & (fldName & ": " & formElementValue & vbCrLf)
strBody = strBody & ( vbCrLf & vbCrlf & strFooter )
'Time to send the email
Set objNewMail = Server.CreateObject("CDONT
objNewMail.From = "CustReq@dilys.com.com"
objNewMail.To = strTo
objNewMail.cc = "CSCONTACT@dilyscomp.com"
objNewMail.Subject = strSubject
objNewMail.Body = strBody
Set objNewMail = Nothing
'redirect to thank you page then home page