I see the error. That's a default error page not the real error message.
In
Internet Explorer go to Tools, Internet Options, Advanced and uncheck
Show
friendly HTTP error messages. Once you do that you'll see that the real
error is:
Microsoft VBScript compilation error '800a0400'
Expected statement
/Sendemail.asp, line 5
Dim iMsg
^
What's happening is that you have a > symbol in front of the Dim iMsg.
Delete it. I'm guessing that when you copied and pasted the code I gave
you
from the post you included those little >> symbols that appear in a
reply.
Make sure you don't have any of those. Also, watch out for line wrapping
with the code I posted (news readers have a bad habit of doing that). If
you see an error it may be because the line wrapped.
I'm attaching the code in Notepad that shouldn't line wrap. Open the
attachment and paste all that code into the page again (remove what you
have) to make sure it's all correct.
Yes all - I know we discourage news group attachments but OE drives me
nuts
with line wraps. I'll take the abuse.
Dave
Made changes. Sendemail page will not display.
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot
be
displayed.
--------------------------------------------------------------------------------
Please try the following:
Open the
www.finishlineservices.biz home page, and then look for links
to
the information you want.
Click the Refresh button, or try again later.
Click Search to look for information on the Internet.
You can also see a list of related sites.
HTTP 500 - Internal server error
Internet Explorer
:
The page MUST be a .asp page for this to work and you can NOT use the
FrontPage Forms handler to do this (it doesn't work with .asp pages).
You'll have to use all ASP code to send the email.
What page (exactly) is the one with the issue and what's the page that
passes the information? I looked at the site and it appears that you
want
useddetails.asp to pass a STOCKID to new_page_2.htm when someone
clicks
"Get
Info". Is that correct? I don't see any hidden fields on
new_page_2.htm
If so, here's what you need to do:
On useddetails.asp change the Get Info link to point to the .asp page
with
the form
<a href="new_page_2.asp?STOCKID= .. <leave your code to retrieve the
number>
... ">Get Info</a>
Then rename new_page_2.htm to new_page_2.asp
On new_page_2.asp remove ALL the FrontPage web bot code (FrontPage
Forms
handler) and change the form tag to read:
<FORM METHOD="POST" ACTION="sendemail.asp">
Add back in the hidden field
<input type="hidden" name="ID"
value="<%=Request.QueryString("STOCKID")%>">
Now create a NEW page called sendemail.asp. Switch to Code View and
Delete
EVERYTHING there (all HTML code) and paste in this code:
<%
Dim iMsg
Dim iConf
Dim Flds
Dim strText
' set the CDOSYS configuration fields to use port 25 on the SMTP
server
Const cdoSendUsingPort = 2
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
..Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
..Item("
http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.finishlineservices.biz"
..Item("
http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 10
..Update
End With
strText = "Name: " & trim(Request.Form("Contact_FullName")) & vbCrLf
strText = strText & "Title: " & trim(Request.Form("Contact_Title")) &
vbCrLf
strText = strText & "Organization: " &
trim(Request.Form("Contact_Organization")) & vbCrLf
strText = strText & "Work Phone: " &
trim(Request.Form("Contact_WorkPhone"))
& vbCrLf
strText = strText & "Fax: " & trim(Request.Form("Contact_FAX")) &
vbCrLf
strText = strText & "Email: " & trim(Request.Form("Contact_Email")) &
vbCrLf
strText = strText & "URL: " & trim(Request.Form("Contact_URL")) &
vbCrLf
&
vbCrLf
strText = strText & "Please send more information about stock number"
&
trim(Request.Form("ID")) & vbCrLf
With iMsg
Set .Configuration = iConf
..To = "(e-mail address removed)"
..From = trim(Request.Form("Contact_Email"))
..Subject = "Information Request"
..TextBody = strText
..Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
Response.Redirect ("useddetails.asp?STOCKID=" &
trim(Request.Form("ID")) )
%>
You can edit the context of the email as you'd like. NOTE: You'll
need
to
find out the correct name of your mail server from your web host. In
the
code above I put mail.finishlineservices.biz but if that's not correct
you'll need to change it.
Finally, the last line above (response.redirect) is where they get
sent
after the email is sent. In this example I pass them back to the
useddetails page. You can change this to wherever you want them to
go.
When you're done you should have 3 pages:
useddetails.asp
new_page_2.asp
sendemail.asp
HTH
Made changes. Published. The info request page clears out what was
entered
(by end user) and does not send to email. site is
www.finishlineservices.biz. Renamed page to htm from asp it send to
email
but
will not carry the hidden field.
:
Thanks
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________
| Stefan, Couple syntax corrections. The hidden field and is
missing
<%
%>.
| and the hyperlink needs some quotes. It should read:
|
| <a href="theformpage.asp?ID=<%=FP_Field(rs, fldname)%>">Get
Info</a>
|
| <input type="hidden" name="ID"
value="<%=Request.QueryString("ID")%>">
|
|
|
| | > Insert a column in the DBR table
| > In that column insert a link to another ASP page
| > (which will contain a form with the info request)
| > and
| > In the hyperlink add a parameter to identify the record
involved
to
you
| > when you get the email
| > (using some unique field (fldname below) from the DBR which
identifies
| > that record)
| >
| > So in the cell the link would look like
| > <a href="theformpage.asp?ID=<%=FP_Field(rs, fldname)%>>Get
Info</a>
| >
| > On the receiving end, in the form add a hidden form field with
that
ID
| > <input type="hidden" name="ID"
value="Request.QueryString("ID")>
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| >
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
| > _____________________________________________
| >
| >
| > | > | Sure could usse a bit of help on this one