Ask a Question related to Dreamweaver AppDev, Design and Development.
-
innovationlab #1
Formmail works only partially?
I have 2 different forms in my site using formmail to send it to my email. One
page sends and redirects successfully, only none of the info in text boxes is
submitted. I have another formmail that redirects successfully but never makes
it to my email at all. I've included the script for the one that works
partially. The other is exactly the same but with different questions. Any
ideas on the problem?
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/Clients.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="not_authorized.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" &
Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Session("MM_username") <> "") Then
Recordset1__MMColParam = Session("MM_username")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_Clients_STRING
Recordset1.Source = "SELECT * FROM clients WHERE username = '" +
Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library" -->
<%
Response.Buffer = true
Session.Abandon()
if Request.ServerVariables("REQUEST_METHOD") = "POST" then ' user is
sending a cancellation
' create the e-mail object and set the various fields
Set objMessage = Server.CreateObject("CDO.Message")
objMessage.To = "removed@test.com"
objMessage.From = "Innovation Lab Website"
objMessage.ReplyTo = Recordset1.Fields.Item("email")
objMessage.Sender = "removed@test.com"
objMessage.Subject = "Cancel a Reservation"
BodyText = BodyText & "<p>Cancel the following:.</p>"
BodyText = BodyText & "<table>"
BodyText = BodyText & "<tr><td
align=right>Name:</td><td>"&Recordset1.Fields.Item("full").Value&"</td></tr>"
BodyText = BodyText & "<tr><td align=right>Company:</td><td>"
&Recordset1.Fields.Item("company").Value&"</td></tr>"
BodyText = BodyText & "<tr><td align=right>Email:</td><td>"
&Recordset1.Fields.Item("email").Value&"</td></tr>"
BodyText = BodyText & "<tr><td align=right>Room:</td><td>"
&Request.Form("room")&"</td></tr>"
BodyText = BodyText & "<tr><td align=right>Date:</td><td>"
&Request.Form("dte")&"</td></tr>"
BodyText = BodyText & "<tr><td align=right>Time:</td><td>"
&Request.Form("tme")&"</td></tr>"
BodyText = BodyText & "</table>"
objMessage.HTMLBody = BodyText
' specify mail server information
set objConfig = Server.CreateObject("CDO.Configuration")
objConfig.Fields(cdoSendUsingMethod) = 2
objConfig.Fields(cdoSMTPServer) = "removed.email.com"
objConfig.Fields(cdoSMTPServerPort) = 25
objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
objConfig.Fields.Update
set objMessage.Configuration = objConfig
' send the message and dispose of the object
objMessage.Send()
set objConfig = Nothing
set objMessage = Nothing
Server.Transfer ("cancellation_thank_you.htm")
'else visitor is going to view the cancellation page
Server.Transfer ("index.htm")
end if
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
innovationlab Guest
-
FormMail help needed
I'm stuck. I read a bunch of entries on this forum, but still stuck. I'm not sure how to retrieve the form results from my webpage. I realize the... -
formmail.cgi problem
Hi, I have found a cgi-script to send the result of a form to my e-mail address. But it doesn't work. I know nothing about cgi scripts. I hope... -
FormMail
I need an example of form mail, can you send me the source (*.fla)? Thanks -- m@urich :oD -
[php] formmail.pl formmail.php
Not that formmail.pl was the most secure idea, but it could take any variable off any form and mail the contents to a vriable on that form. Does... -
USB works partially
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hallo! USB support is working because I'm using both a ps2 and a usb mouse (HP Omnibook XT1000... -
bthouin #2
Re: Formmail works only partially?
Hi,
I noticed you are using "+" to concatenate strings at some places. This
is Javascript, not VBScript. Be careful, this can lead to very weird
results (I had the case myself in a not-so-careful conversion from JS to
VB...). As it is on the SELECT of your main recordset, I'd be careful.
Have you checked if your SELECT is successful ? Of course, if it isn't
then no e-mail would ever be created, and you'd got an error, because
you are not trapping EOF.
Regards
Bernard
innovationlab wrote:> I have 2 different forms in my site using formmail to send it to my email. One
> page sends and redirects successfully, only none of the info in text boxes is
> submitted. I have another formmail that redirects successfully but never makes
> it to my email at all. I've included the script for the one that works
> partially. The other is exactly the same but with different questions. Any
> ideas on the problem?
>
>
>
> <%@LANGUAGE="VBSCRIPT"%>
> <!--#include file="Connections/Clients.asp" -->
> <%
> ' *** Restrict Access To Page: Grant or deny access to this page
> MM_authorizedUsers=""
> MM_authFailedURL="not_authorized.asp"
> MM_grantAccess=false
> If Session("MM_Username") <> "" Then
> If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
> (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
> MM_grantAccess = true
> End If
> End If
> If Not MM_grantAccess Then
> MM_qsChar = "?"
> If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
> MM_referrer = Request.ServerVariables("URL")
> if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" &
> Request.QueryString()
> MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
> Server.URLEncode(MM_referrer)
> Response.Redirect(MM_authFailedURL)
> End If
> %>
> <%
> Dim Recordset1__MMColParam
> Recordset1__MMColParam = "1"
> If (Session("MM_username") <> "") Then
> Recordset1__MMColParam = Session("MM_username")
> End If
> %>
> <%
> Dim Recordset1
> Dim Recordset1_numRows
>
> Set Recordset1 = Server.CreateObject("ADODB.Recordset")
> Recordset1.ActiveConnection = MM_Clients_STRING
> Recordset1.Source = "SELECT * FROM clients WHERE username = '" +
> Replace(Recordset1__MMColParam, "'", "''") + "'"
> Recordset1.CursorType = 0
> Recordset1.CursorLocation = 2
> Recordset1.LockType = 1
> Recordset1.Open()
>
> Recordset1_numRows = 0
> %>
> <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
> NAME="CDO for Windows 2000 Library" -->
> <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
> NAME="ADODB Type Library" -->
> <%
> Response.Buffer = true
> Session.Abandon()
>
> if Request.ServerVariables("REQUEST_METHOD") = "POST" then ' user is
> sending a cancellation
>
> ' create the e-mail object and set the various fields
> Set objMessage = Server.CreateObject("CDO.Message")
> objMessage.To = "removed@test.com"
> objMessage.From = "Innovation Lab Website"
> objMessage.ReplyTo = Recordset1.Fields.Item("email")
> objMessage.Sender = "removed@test.com"
> objMessage.Subject = "Cancel a Reservation"
> BodyText = BodyText & "<p>Cancel the following:.</p>"
> BodyText = BodyText & "<table>"
> BodyText = BodyText & "<tr><td
> align=right>Name:</td><td>"&Recordset1.Fields.Item("full").Value&"</td></tr>"
> BodyText = BodyText & "<tr><td align=right>Company:</td><td>"
> &Recordset1.Fields.Item("company").Value&"</td></tr>"
> BodyText = BodyText & "<tr><td align=right>Email:</td><td>"
> &Recordset1.Fields.Item("email").Value&"</td></tr>"
> BodyText = BodyText & "<tr><td align=right>Room:</td><td>"
> &Request.Form("room")&"</td></tr>"
> BodyText = BodyText & "<tr><td align=right>Date:</td><td>"
> &Request.Form("dte")&"</td></tr>"
> BodyText = BodyText & "<tr><td align=right>Time:</td><td>"
> &Request.Form("tme")&"</td></tr>"
> BodyText = BodyText & "</table>"
> objMessage.HTMLBody = BodyText
>
> ' specify mail server information
> set objConfig = Server.CreateObject("CDO.Configuration")
> objConfig.Fields(cdoSendUsingMethod) = 2
> objConfig.Fields(cdoSMTPServer) = "removed.email.com"
> objConfig.Fields(cdoSMTPServerPort) = 25
> objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
> objConfig.Fields.Update
> set objMessage.Configuration = objConfig
>
> ' send the message and dispose of the object
> objMessage.Send()
> set objConfig = Nothing
> set objMessage = Nothing
> Server.Transfer ("cancellation_thank_you.htm")
> 'else visitor is going to view the cancellation page
> Server.Transfer ("index.htm")
> end if
>
> %>
> <%
> Recordset1.Close()
> Set Recordset1 = Nothing
> %>
>bthouin Guest



Reply With Quote

