• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

Is there any way I can convert characters that I'm receiving in an email message from an asp form page

Hi,
I'm getting the following in an email: Name=Somename&Date=9%2F23%2F2003

I'm sending this email from a form in an asp page, using CDOsys. I'm using mailStr = Request.Form, which gathers the data from the previous page.

Any idea how the email, when I receive it, can be formatted:
Name = Somename
Date = SomeDate

Thanks,
Sean
0
seanpowell
Asked:
seanpowell
  • 3
1 Solution
 
a_goatCommented:
mailStr = "Name: " & Request.form("Name") & vbCrLf & "Date: " & Request.form("date")

if it puts it all on one line, try putting:

vbCrLf = Chr(13) & Chr(10)

Just before that line.

0
 
a_goatCommented:
Oh, one more suggestion, try this:

vbCrLf = Chr(13) & Chr(10)

Message = ""
for each Key in request.form
    Message = Message & Key & ": " & Request.form(Key) & vbCrLf
next

mailStr = Message

That will list every key on a separate line with all infor formatted.
0
 
ClarionCommented:
This should do the job:

Dim namepos, datepos
Dim namestr, datestr

namepos = instr( mailStr, "Name=" )
datepos = instr( mailStr, "Date=" )

namestr = mid( mailStr, namepos, datepos - namepos - 5)

datestr = mid( mailStr, datepos)

datestr = replace( datestr, "%2F", "-" )

Response.Write "<br>Name = " & namestr
Response.Write "<br>Date = " & datestr

Bye...
0
 
seanpowellAuthor Commented:
Thanks so much. Apparently it's always a good idea to have a goat around.
0
 
a_goatCommented:
hell yeah it is

;-)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now