Forums
This topic is locked
After Insert Record send Email to Admin
Posted 23 Apr 2002 00:35:57
1
has voted
23 Apr 2002 00:35:57 Frank Munoz posted:
What I'm trying to do is, create a form that a customer will fill out and submit to create an account, upon submitting the form (insert record), the customer is redirected to the confirmation page and an automatic email is automatically sent to me (Administrator) notifying me of the new customer account created.Is there an extension or a simple method of doing this type of concept?
I am using ASP inserting to MySQL database on a Cobalt Raq 3.
Replies
Replied 21 Dec 2002 02:56:45
21 Dec 2002 02:56:45 A. B. replied:
Has anyone solved this or does anyone know if an extension is available that performs this function?
Also, how do you pull the data from the record you just inserted and e-mail that information to the user (or administrator)?
Thanks.
Andrea
Also, how do you pull the data from the record you just inserted and e-mail that information to the user (or administrator)?
Thanks.
Andrea
Replied 21 Dec 2002 11:56:48
21 Dec 2002 11:56:48 Dave Clarke replied:
What mail component are you using JMail?? CDONTS?? ASPMail?
I have a system that email the user their details after they submit a form, this could easily be altered to email the administrator. .. I use Jmail.
What you need to do is in the insert record behaviour, in the "after inserting go to" box put your page that creates your mail, and then on this page, after the mail is constructed and sent have a redirect to your confirmation page.
You don't neccessarily have to pull the data just submitted from the database, you can take the values from the form that the user is submitting and convert it to a variable and then put this in the body of your email.
Obviously these are just a few points to get you thinking.
I may be able to help further.
Dave
ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome
I have a system that email the user their details after they submit a form, this could easily be altered to email the administrator. .. I use Jmail.
What you need to do is in the insert record behaviour, in the "after inserting go to" box put your page that creates your mail, and then on this page, after the mail is constructed and sent have a redirect to your confirmation page.
You don't neccessarily have to pull the data just submitted from the database, you can take the values from the form that the user is submitting and convert it to a variable and then put this in the body of your email.
Obviously these are just a few points to get you thinking.
I may be able to help further.
Dave
ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome
Replied 21 Dec 2002 19:48:53
21 Dec 2002 19:48:53 asp asp replied:
Hi! there is an extension you can purchase at www.webassist.com thats will do what you want, im hopping that they will make on available here.
Replied 21 Dec 2002 21:18:18
21 Dec 2002 21:18:18 A. B. replied:
Dave or anyone...
I'm having problems passing the values from my insert page to a confirmation page that sends out a CDONTS e-mail using the insert form fields. I followed the "Passing Form Vaues from Insert Page to Another Page" tutorial, but I'm still not getting the e-mail. In the tutorial though, I noticed something strange - there are differences between my original code and the code the tutorial states.
The tutorial says the original Macromedia code is the same for all inserts:
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> ""
Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> ""
Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
However, the original Macromedia code in my insert page says this:
// append the query string to the redirect URL
if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.length > 0) {
MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&"
+ Request.QueryString;
}
I changed the request.querystring to request.form on the insert page like the tutorial says. I also used the <% = Request.QueryString("yourvalue"
%> on the confirmation page, but no e-mail is being sent. I am feeling so frustrated. Can anyone help me????
Here is part of my CDONTS code that appears below the META tag on my confirmation page: By the way, the server where site is hosted is configured for CDONTS (I've used it before for forms that were no inserts).
<% @language="VBSCRIPT" %>
<%
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail"
objMail.AttachFile Server.MapPath("grantform4.doc"
IDDesc = request.form("hIDDesc"
GrantID = request.form("hGrantID"
ProjectTitle = request.form("hProjectTitle"
Name = request.form("hName"
Email = request.form("hEmail"
PWork = request.form("hPWork"
PHome = request.form("hPHome"
PFax = request.form("hPFax"
objMail.From= Email
objMail.To=" "
objMail.Cc= " "
objMail.Importance = 1 '(0=Low, 1=Normal, 2=High)
objMail.Subject="Confirmation Request"
objMail.Body = "Thank you for submitting your application. Below is the information that was submitted via the Grant Application form." & vbCRLF& vbCRLF& "Your confirmation code: " & IDDesc & GrantID & vbCRLF& "Project Title: " & ProjectTitle & vbCRLF& "Contact Name: " & Name & vbCRLF& "Email Address: " & Email & vbCRLF& "Work Number: " & PWork & vbCRLF& "Home Number: " & PHome & vbCRLF& "Fax Number: " & PFax & vbCRLF&
objMail.Send
set objMail=nothing
%>
I'm having problems passing the values from my insert page to a confirmation page that sends out a CDONTS e-mail using the insert form fields. I followed the "Passing Form Vaues from Insert Page to Another Page" tutorial, but I'm still not getting the e-mail. In the tutorial though, I noticed something strange - there are differences between my original code and the code the tutorial states.
The tutorial says the original Macromedia code is the same for all inserts:
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> ""

If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> ""

MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
However, the original Macromedia code in my insert page says this:
// append the query string to the redirect URL
if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.length > 0) {
MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&"

}
I changed the request.querystring to request.form on the insert page like the tutorial says. I also used the <% = Request.QueryString("yourvalue"

Here is part of my CDONTS code that appears below the META tag on my confirmation page: By the way, the server where site is hosted is configured for CDONTS (I've used it before for forms that were no inserts).
<% @language="VBSCRIPT" %>
<%
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail"

objMail.AttachFile Server.MapPath("grantform4.doc"

IDDesc = request.form("hIDDesc"

GrantID = request.form("hGrantID"

ProjectTitle = request.form("hProjectTitle"

Name = request.form("hName"

Email = request.form("hEmail"

PWork = request.form("hPWork"

PHome = request.form("hPHome"

PFax = request.form("hPFax"

objMail.From= Email
objMail.To=" "
objMail.Cc= " "
objMail.Importance = 1 '(0=Low, 1=Normal, 2=High)
objMail.Subject="Confirmation Request"
objMail.Body = "Thank you for submitting your application. Below is the information that was submitted via the Grant Application form." & vbCRLF& vbCRLF& "Your confirmation code: " & IDDesc & GrantID & vbCRLF& "Project Title: " & ProjectTitle & vbCRLF& "Contact Name: " & Name & vbCRLF& "Email Address: " & Email & vbCRLF& "Work Number: " & PWork & vbCRLF& "Home Number: " & PHome & vbCRLF& "Fax Number: " & PFax & vbCRLF&
objMail.Send
set objMail=nothing
%>
Replied 22 Dec 2002 02:28:30
22 Dec 2002 02:28:30 asp asp replied:
Well here is what you do!!
1. Create a normal inser record. on the form page that will insert the users infomation. and have the page go to a thankyou.asp (call it anything) on that 1st page you will grab the users info and save it in a session. put the right under your connection string at the top of the 1st page.
<% Session("svUsername"
= Request.Form("varUsername"
%>
varUsername will be the name of your filed were the user inputs the name.
2. now go to the thankyou page and lets retreive the info that was just inserted into the DB,
create a new record set and grab the info from the DB. GO into advanced mode.
SELECT *
FROM dbo.THE DB NAME
WHERE username = 'strUsername'
NAME = strUsername
DEFAULT VALUE = XYZ
RUNTIME VALUE = session("strUsername"
now you have retrived the user from the DB that just cliked submit from the previous page.
3. Enter this above the HTML TAG on your Thankyou page to send the email.
*username = the DB table name
now you just passed a string to this page lets get the user from the DB that has just filled out the form
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
Mailer.FromName = "SOMEONE"
Mailer.FromAddress= " "
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient "" , rsConfirm.Fields.Item("email"
Mailer.AddBCC "annie", " "
Mailer.Subject = "whatever"
Mailer.BodyText = "Thank you for your recent information" & VbCrLf & VbCrLf & "We are pleased to tell you that your account has now been set up and you are able to securely view work in progress, quotes & proofs" & VbCrLf & VbCrLf & "Username: " & rsConfirm.Fields.Item("Username"
& VbCrLf & "Password: " & rsConfirm.Fields.Item("Password"
& VbCrLf & VbCrLf & "Please keep this information in a safe place." & VbCrLf & VbCrLf & "Email notifications of new files in your account will be sent to you: " & rsConfirm.Fields.Item("email"
& VbCrLf & VbCrLf & "You can now sign in by visiting" & VbCrLf & VbCrLf & "www.whatever.com"
if Mailer.SendMail then
Response.Write ""
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>
all the rsConfirm.Fields.Item("Password"
are grabed from the DB, you will have to replace the RS with your own and also the table name! thats it!
hope this help!
1. Create a normal inser record. on the form page that will insert the users infomation. and have the page go to a thankyou.asp (call it anything) on that 1st page you will grab the users info and save it in a session. put the right under your connection string at the top of the 1st page.
<% Session("svUsername"


varUsername will be the name of your filed were the user inputs the name.
2. now go to the thankyou page and lets retreive the info that was just inserted into the DB,
create a new record set and grab the info from the DB. GO into advanced mode.
SELECT *
FROM dbo.THE DB NAME
WHERE username = 'strUsername'
NAME = strUsername
DEFAULT VALUE = XYZ
RUNTIME VALUE = session("strUsername"

now you have retrived the user from the DB that just cliked submit from the previous page.
3. Enter this above the HTML TAG on your Thankyou page to send the email.
*username = the DB table name
now you just passed a string to this page lets get the user from the DB that has just filled out the form
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"

Mailer.FromName = "SOMEONE"
Mailer.FromAddress= " "
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient "" , rsConfirm.Fields.Item("email"

Mailer.AddBCC "annie", " "
Mailer.Subject = "whatever"
Mailer.BodyText = "Thank you for your recent information" & VbCrLf & VbCrLf & "We are pleased to tell you that your account has now been set up and you are able to securely view work in progress, quotes & proofs" & VbCrLf & VbCrLf & "Username: " & rsConfirm.Fields.Item("Username"



if Mailer.SendMail then
Response.Write ""
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>
all the rsConfirm.Fields.Item("Password"

hope this help!
Replied 22 Dec 2002 03:23:21
22 Dec 2002 03:23:21 A. B. replied:
Okay, I've followed your steps to the letter. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> I did change the session to "Name" instead of "Usename". I get the following error:
Microsoft JScript compilation error '800a03ec'
Expected ';'
/pef/Copy of pre_app_thankyou.asp, line 23
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
----^
I know this code is long, but please bear with me. This is the code on my thankyou page directly above the HTML tag:
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="../../Connections/connPEFGrantApp.asp" -->
<%
var rsMailInfo__strName = "xyz";
if(String(session("strName"
) != "undefined"
{
rsMailInfo__strName = String(session("strName"
);
}
%>
<%
var rsMailInfo = Server.CreateObject("ADODB.Recordset"
;
rsMailInfo.ActiveConnection = MM_connPEFGrantApp_STRING;
rsMailInfo.Source = "SELECT * FROM dbo.Grants WHERE Name = '"+ rsMailInfo__strName.replace(/'/g, "''"
+ "'";
rsMailInfo.CursorType = 0;
rsMailInfo.CursorLocation = 2;
rsMailInfo.LockType = 3;
rsMailInfo.Open();
var rsMailInfo_numRows = 0;
%>
*Name = Grants
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
Mailer.FromName = "Public Education Foundation of Little Rock"
Mailer.FromAddress= " "
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient "" , rsMailInfo.Fields.Item("Email"
Mailer.AddBCC "Bob Johnston", " "
Mailer.Subject = "Grant Application Confirmation"
Mailer.AttachFile Server.MapPath("grantform4.doc"
Mailer.BodyText = "Thank you for submitting your application. Below is the information that was submitted via the Grant Application form." & VbCrLf & VbCrLf & "Confirmation Code: " & rsMailInfo.Fields.Item("IDDesc"
& rsMailInfo.Fields.Item("GrantID"
& VbCrLf & "Project Title: " & rsMailInfo.Fields.Item("ProjectTitle"
& VbCrLf & VbCrLf & "Contact Name: " & rsMailInfo.Fields.Item("Name"
& VbCrLf & VbCrLf & "Email: " & rsMailInfo.Fields.Item("Email"
& VbCrLf & VbCrLf & "Work Phone: " & rsMainInfo.Fields.Item("PWork"
& VbCrLf& & VbCrLf & "Home Phone: " & rsMainInfo.Fields.Item("PHome"
& vbCRLF& & VbCrLf & "Fax Number: " & rsMainInfo.Fields.Item("PFax"
& vbCRLF& & VbCrLf & "Applicants associated with proposal: " & rsMainInfo.Fields.Item("Applicants"
& vbCRLF& & VbCrLf & "School Name: " & rsMainInfo.Fields.Item("SchoolNameDesc"
& vbCRLF& & VbCrLf & "School Principal: " & rsMainInfo.Fields.Item("Principal"
& vbCRLF& & VbCrLf & "Teaching Assignment - Grade: " & rsMainInfo.Fields.Item("GradeDesc"
& vbCRLF& & VbCrLf & "Teaching Assignment - Subject: " & rsMainInfo.Fields.Item("Subject"
& vbCRLF& & VbCrLf & "Project Implementation Date: " & rsMainInfo.Fields.Item("ImpBegDt"
& vbCRLF& & VbCrLf & "Project Completion Date: " & rsMainInfo.Fields.Item("ImpCompDt"
& vbCRLF& & VbCrLf & "Total amount requested: " & rsMainInfo.Fields.Item("RequestAmt"
& vbCRLF& & VbCrLf & "Total amount donated: " & rsMainInfo.Fields.Item("DonationAmt"
& vbCRLF& & VbCrLf & "Total amount budgeted: " & rsMainInfo.Fields.Item("BudgetAmt"
& vbCRLF& & VbCrLf & "Proposal targets specific groups: " & rsMainInfo.Fields.Item("TargetStudentDesc"
& vbCRLF& & VbCrLf & "Proposal gender or race specific: " & rsMainInfo.Fields.Item("GenderOrRaceDesc"
& vbCRLF& & VbCrLf & "Proposal addresses children in these grades: " & rsMainInfo.Fields.Item("SupportGrades"
& vbCRLF& & VbCrLf & "Discipline: " & rsMainInfo.Fields.Item("RadioDesc"
& vbCRLF& & VbCrLf & "Other Discipline Description: " & rsMainInfo.Fields.Item("OtherRadioDesc"
"Please visit us again at " & VbCrLf & VbCrLf & "www.asjohnston.com"
if Mailer.SendMail then
Response.Write ""
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>
<html>
Microsoft JScript compilation error '800a03ec'
Expected ';'
/pef/Copy of pre_app_thankyou.asp, line 23
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"

----^
I know this code is long, but please bear with me. This is the code on my thankyou page directly above the HTML tag:
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="../../Connections/connPEFGrantApp.asp" -->
<%
var rsMailInfo__strName = "xyz";
if(String(session("strName"


rsMailInfo__strName = String(session("strName"

}
%>
<%
var rsMailInfo = Server.CreateObject("ADODB.Recordset"

rsMailInfo.ActiveConnection = MM_connPEFGrantApp_STRING;
rsMailInfo.Source = "SELECT * FROM dbo.Grants WHERE Name = '"+ rsMailInfo__strName.replace(/'/g, "''"

rsMailInfo.CursorType = 0;
rsMailInfo.CursorLocation = 2;
rsMailInfo.LockType = 3;
rsMailInfo.Open();
var rsMailInfo_numRows = 0;
%>
*Name = Grants
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"

Mailer.FromName = "Public Education Foundation of Little Rock"
Mailer.FromAddress= " "
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient "" , rsMailInfo.Fields.Item("Email"

Mailer.AddBCC "Bob Johnston", " "
Mailer.Subject = "Grant Application Confirmation"
Mailer.AttachFile Server.MapPath("grantform4.doc"

Mailer.BodyText = "Thank you for submitting your application. Below is the information that was submitted via the Grant Application form." & VbCrLf & VbCrLf & "Confirmation Code: " & rsMailInfo.Fields.Item("IDDesc"























"Please visit us again at " & VbCrLf & VbCrLf & "www.asjohnston.com"
if Mailer.SendMail then
Response.Write ""
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>
<html>
Replied 22 Dec 2002 06:31:07
22 Dec 2002 06:31:07 asp asp replied:
Hey! well i see you using JAVASCRIPT,
Are you telling the compiler that instead of the default language you are
using VBScript? i.e. :
<%@Language="VBScript"%>
at the top of your pages?
Are you telling the compiler that instead of the default language you are
using VBScript? i.e. :
<%@Language="VBScript"%>
at the top of your pages?
Replied 22 Dec 2002 14:35:41
22 Dec 2002 14:35:41 A. B. replied:
asp,
Wow, what a morning it's been already. I changed my pages from JavaScript to VBScript (yep, redid all the recordsets, etc.). I followed the steps you suggested again, but I now receive the following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'AddRecipient'
/pef/Copy of pre_app_thankyou.asp, line 24
What do you think the hangup is with AddRecipient? My code above the HTML tag is as follows:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connPEFGrantApp.asp" -->
<%
Dim rsMailInfo__strName
rsMailInfo__strName = "xyz"
if (session("strName"
<> ""
then rsMailInfo__strName = session("strName"
%>
<%
set rsMailInfo = Server.CreateObject("ADODB.Recordset"
rsMailInfo.ActiveConnection = MM_connPEFGrantApp_STRING
rsMailInfo.Source = "SELECT * FROM dbo.Grants WHERE Name = '" + Replace(rsMailInfo__strName, "'", "''"
+ "'"
rsMailInfo.CursorType = 0
rsMailInfo.CursorLocation = 2
rsMailInfo.LockType = 3
rsMailInfo.Open()
rsMailInfo_numRows = 0
%>
*Name = Grants
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
Mailer.FromName = "Little Rock"
Mailer.FromAddress= " "
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient "" , rsMailInfo.Fields.Item("Email"
Mailer.AddBCC "Bob", " "
Mailer.Subject = "Grant Application Confirmation"
Mailer.AttachFile Server.MapPath("grantform4.doc"
Mailer.BodyText = "Thank you for submitting your application. Below is the information that was submitted via the Grant Application form." & VbCrLf & VbCrLf & "Confirmation Code: " & rsMailInfo.Fields.Item("IDDesc"
& rsMailInfo.Fields.Item("GrantID"
& VbCrLf & "Project Title: " & rsMailInfo.Fields.Item("ProjectTitle"
& VbCrLf & VbCrLf & "Contact Name: " & rsMailInfo.Fields.Item("Name"
& VbCrLf & VbCrLf & "Email: " & rsMailInfo.Fields.Item("Email"
& VbCrLf & VbCrLf & "Work Phone: " & rsMainInfo.Fields.Item("PWork"
& VbCrLf & VbCrLf & "Home Phone: " & rsMainInfo.Fields.Item("PHome"
& vbCRLF & VbCrLf & "Fax Number: " & rsMainInfo.Fields.Item("PFax"
& VbCRLF & VbCrLf & "Applicants associated with proposal: " & rsMainInfo.Fields.Item("Applicants"
& VbCRLF & VbCrLf & "School Name: " & rsMainInfo.Fields.Item("SchoolNameDesc"
& VbCRLF & VbCrLf & "School Principal: " & rsMainInfo.Fields.Item("Principal"
& VbCRLF & VbCrLf & "Teaching Assignment - Grade: " & rsMainInfo.Fields.Item("GradeDesc"
& VbCRLF & VbCrLf & "Teaching Assignment - Subject: " & rsMainInfo.Fields.Item("Subject"
& VbCRLF & VbCrLf & "Project Implementation Date: " & rsMainInfo.Fields.Item("ImpBegDt"
& VbCRLF & VbCrLf & "Project Completion Date: " & rsMainInfo.Fields.Item("ImpCompDt"
& VbCRLF & VbCrLf & "Total amount requested: " & rsMainInfo.Fields.Item("RequestAmt"
& VbCRLF & VbCrLf & "Total amount donated: " & rsMainInfo.Fields.Item("DonationAmt"
& VbCRLF & VbCrLf & "Total amount budgeted: " & rsMainInfo.Fields.Item("BudgetAmt"
& VbCRLF & VbCrLf & "Proposal targets specific groups: " & rsMainInfo.Fields.Item("TargetStudentDesc"
& VbCRLF & VbCrLf & "Proposal gender or race specific: " & rsMainInfo.Fields.Item("GenderOrRaceDesc"
& VbCRLF & VbCrLf & "Proposal addresses children in these grades: " & rsMainInfo.Fields.Item("SupportGrades"
& VbCRLF & VbCrLf & "Discipline: " & rsMainInfo.Fields.Item("RadioDesc"
& VbCRLF & VbCrLf & "Other Discipline Description: " & rsMainInfo.Fields.Item("OtherRadioDesc"
& VbCrLf & VbCrLf & "Please visit us again at " & VbCrLf & VbCrLf & "www.asjohnston.com"
if Mailer.SendMail then
Response.Write ""
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>
<HTML>
Wow, what a morning it's been already. I changed my pages from JavaScript to VBScript (yep, redid all the recordsets, etc.). I followed the steps you suggested again, but I now receive the following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'AddRecipient'
/pef/Copy of pre_app_thankyou.asp, line 24
What do you think the hangup is with AddRecipient? My code above the HTML tag is as follows:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connPEFGrantApp.asp" -->
<%
Dim rsMailInfo__strName
rsMailInfo__strName = "xyz"
if (session("strName"



%>
<%
set rsMailInfo = Server.CreateObject("ADODB.Recordset"

rsMailInfo.ActiveConnection = MM_connPEFGrantApp_STRING
rsMailInfo.Source = "SELECT * FROM dbo.Grants WHERE Name = '" + Replace(rsMailInfo__strName, "'", "''"

rsMailInfo.CursorType = 0
rsMailInfo.CursorLocation = 2
rsMailInfo.LockType = 3
rsMailInfo.Open()
rsMailInfo_numRows = 0
%>
*Name = Grants
<%
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"

Mailer.FromName = "Little Rock"
Mailer.FromAddress= " "
Mailer.RemoteHost = "localhost"
Mailer.AddRecipient "" , rsMailInfo.Fields.Item("Email"

Mailer.AddBCC "Bob", " "
Mailer.Subject = "Grant Application Confirmation"
Mailer.AttachFile Server.MapPath("grantform4.doc"

Mailer.BodyText = "Thank you for submitting your application. Below is the information that was submitted via the Grant Application form." & VbCrLf & VbCrLf & "Confirmation Code: " & rsMailInfo.Fields.Item("IDDesc"























if Mailer.SendMail then
Response.Write ""
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if
%>
<HTML>
Replied 22 Dec 2002 17:32:38
22 Dec 2002 17:32:38 asp asp replied:
Hi! ok heres what i would do! replace
Mailer.AddRecipient "" , rsMailInfo.Fields.Item("Email"
with
Mailer.AddRecipient "someone" , " "
now replace the someone stuff with your email! if it works then have a close look at you FORM fields from the 1st page and make sure that there are no typos and CASE SENaTivE, makes sure your table ie called Email NOT email, USUALLY that results because the types of information accepted in the database do not coincide with the variables transferred in.
asp
Mailer.AddRecipient "" , rsMailInfo.Fields.Item("Email"

with
Mailer.AddRecipient "someone" , " "
now replace the someone stuff with your email! if it works then have a close look at you FORM fields from the 1st page and make sure that there are no typos and CASE SENaTivE, makes sure your table ie called Email NOT email, USUALLY that results because the types of information accepted in the database do not coincide with the variables transferred in.
asp
Replied 22 Dec 2002 17:48:07
22 Dec 2002 17:48:07 asp asp replied:
opps! also! look at the start
<%
Dim rsMailInfo__strName
rsMailInfo__strName = "xyz"
if (Session("strName"
<> ""
then
rsMailInfo__strName = session("strName"
%>
strName is a string not a sesion! replace session("strName"
with the session var you created on the 1st page! which should be something like
<% Session("svUsername"
= Request.Form("varUsername"
%>
varUsername = the Form Field Name
Session = session("svUsername"
NOT strName
<%
Dim rsMailInfo__strName
rsMailInfo__strName = "xyz"
if (Session("strName"


rsMailInfo__strName = session("strName"

%>
strName is a string not a sesion! replace session("strName"

<% Session("svUsername"


varUsername = the Form Field Name
Session = session("svUsername"

NOT strName
Replied 22 Dec 2002 19:38:28
22 Dec 2002 19:38:28 A. B. replied:
Hi. I'm still having problems. Perhaps I've been working on this too long - it's just not making sense to me.
This is the session name on page1 that appears under the connection string:
<% Session("svUsername"
= Request.Form("Name"
%>
This is the error that I receive on page2:
Microsoft VBScript compilation error '800a03ea'
Syntax error
/pef/Copy of pre_app_thankyou.asp, line 6
if (<% Session("svUsername"
= Request.Form("Name"
----^
This is the code before the mail script on page2 (pre_app_thankyou.asp):
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connPEFGrantApp.asp" -->
<%
Dim rsMailInfo__strUsername
rsMailInfo__strUsername = "xyz"
if (<% Session("svUsername"
= Request.Form("Name"
%>
<> ""
then rsMailInfo__strUsername =
<% Session("svUsername"
= Request.Form("Name"
%>
%>
<%
set rsMailInfo = Server.CreateObject("ADODB.Recordset"
rsMailInfo.ActiveConnection = MM_connPEFGrantApp_STRING
rsMailInfo.Source = "SELECT * FROM dbo.Grants WHERE Name = '" + Replace(rsMailInfo__strUsername, "'", "''"
+ "'"
rsMailInfo.CursorType = 0
rsMailInfo.CursorLocation = 2
rsMailInfo.LockType = 3
rsMailInfo.Open()
rsMailInfo_numRows = 0
%>
This is the session name on page1 that appears under the connection string:
<% Session("svUsername"


This is the error that I receive on page2:
Microsoft VBScript compilation error '800a03ea'
Syntax error
/pef/Copy of pre_app_thankyou.asp, line 6
if (<% Session("svUsername"


----^
This is the code before the mail script on page2 (pre_app_thankyou.asp):
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connPEFGrantApp.asp" -->
<%
Dim rsMailInfo__strUsername
rsMailInfo__strUsername = "xyz"
if (<% Session("svUsername"


<> ""

<% Session("svUsername"


%>
<%
set rsMailInfo = Server.CreateObject("ADODB.Recordset"

rsMailInfo.ActiveConnection = MM_connPEFGrantApp_STRING
rsMailInfo.Source = "SELECT * FROM dbo.Grants WHERE Name = '" + Replace(rsMailInfo__strUsername, "'", "''"

rsMailInfo.CursorType = 0
rsMailInfo.CursorLocation = 2
rsMailInfo.LockType = 3
rsMailInfo.Open()
rsMailInfo_numRows = 0
%>
Replied 22 Dec 2002 20:13:41
22 Dec 2002 20:13:41 asp asp replied:
You need at least version 5.0 of VBScript...
Microsoft VBScript compilation error '800a03ea' is compile time error 1002 - Syntax error.
You can get an Update at microsoft.com. hope it worksd out for ya!
Microsoft VBScript compilation error '800a03ea' is compile time error 1002 - Syntax error.
You can get an Update at microsoft.com. hope it worksd out for ya!