html email form

M

Mike Mueller

With the recent spat of guestbook spamming, I am redoing my
GB. I am not using the FP2000 version, I am using an access
db & a drw. The version I am developing will take the info
from the form and create an html email containg a from
pre-populated with the info from the submitted form. I have
run into a few issues and I am on my knees to ask for help.

The form I receive in the email only contains the first word
of what was entered on the forms. Code snippets from the asp
page which sends the email via CDO

dim strTime, strName
dim strHBody
strTime = Now ()
strName = Request.Form("Name")
strHBody = "<html><body>"

strHBody = strHBody & "<form method=""POST""
action=""http://www.domain.com/Entry.asp"">"
strHBody = strHBody & "<p align=""center"">GB beta entry
form was submitted.&nbsp; If these are OK "
strHBody = strHBody & "click accept<br>"
strHBody = strHBody & "<input type=""submit""
value=""Accept"" name=""Submit""></p>"

strHBody = strHBody & "<td>Name</td>"
strHBody = strHBody & "<td><input type=""text""
name=""Name"" size=""50"" value=" & strName &"></td>"

strHBody = strHBody & "<td>Time submitted</td>"
strHBody = strHBody & "<td><input type=""text""
name=""TimeStamp"" size=""50"" value=" & strTime & "></td>"
 
R

Ronx

To take a snippet from your snippet,
change
strHBody = strHBody & "<td><input type=""text""
name=""Name"" size=""50"" value=" & strName &"></td>"

to

strHBody = strHBody & "<td><input type=""text""
name=""Name"" size=""50"" value=""" & strName & """></td>"

Without surrounding the value in quotes, the value will terminate at the
first space, and the second word in the value will become an attribute of
the HTML element.
 
M

Mike Mueller

That did it. What I had just done before that was to
convert all the 1 line text boxes to multi-liners. But your
way looks better and works good

No more spam in my guestbook

Mike




: To take a snippet from your snippet,
: change
: strHBody = strHBody & "<td><input type=""text""
: name=""Name"" size=""50"" value=" & strName &"></td>"
:
: to
:
: strHBody = strHBody & "<td><input type=""text""
: name=""Name"" size=""50"" value=""" & strName & """></td>"
:
: Without surrounding the value in quotes, the value will
terminate at the
: first space, and the second word in the value will become
an attribute of
: the HTML element.
:
: --
: Ron Symonds (Microsoft MVP - FrontPage)
: Reply only to group - emails will be deleted unread.
:
:
message
: : > With the recent spat of guestbook spamming, I am redoing
my
: > GB. I am not using the FP2000 version, I am using an
access
: > db & a drw. The version I am developing will take the
info
: > from the form and create an html email containg a from
: > pre-populated with the info from the submitted form. I
have
: > run into a few issues and I am on my knees to ask for
help.
: >
: > The form I receive in the email only contains the first
word
: > of what was entered on the forms. Code snippets from the
asp
: > page which sends the email via CDO
: >
: > dim strTime, strName
: > dim strHBody
: > strTime = Now ()
: > strName = Request.Form("Name")
: > strHBody = "<html><body>"
: >
: > strHBody = strHBody & "<form method=""POST""
: > action=""http://www.domain.com/Entry.asp"">"
: > strHBody = strHBody & "<p align=""center"">GB beta entry
: > form was submitted.&nbsp; If these are OK "
: > strHBody = strHBody & "click accept<br>"
: > strHBody = strHBody & "<input type=""submit""
: > value=""Accept"" name=""Submit""></p>"
: >
: > strHBody = strHBody & "<td>Name</td>"
: > strHBody = strHBody & "<td><input type=""text""
: > name=""Name"" size=""50"" value=" & strName &"></td>"
: >
: > strHBody = strHBody & "<td>Time submitted</td>"
: > strHBody = strHBody & "<td><input type=""text""
: > name=""TimeStamp"" size=""50"" value=" & strTime &
"></td>"
: >
: >
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top