Flash Form & Asp?

[SIZE=1]Hi Everyone![/SIZE]

[SIZE=1]Thank you to your earlier responses. I had posted that I thought I had made a mistake in the form. But I didn’t. Instead of the info going to a frame named “Result” I would like the submit pushbutton to send the form info to someone by email.

I’m not sure how to get it to go to email. It’s an NT Server that supports ASP, I would like the whole form (input texts, checkboxes and comments fields to be sent by email. Is that possible with this form?

[COLOR=crimson] Please help - I’m losing it!! Thanks again!![/COLOR] [/SIZE]

yes all you have to do to capture the variables in asp is this:


<%
strName = Request.Form("name");
strEmail = request.Form("email")
%>

then use CDONTS to send mail. make sure you are using this AS
[AS]
submit.onRelease= function(){
loadVariablesNum(“mail.asp”,0,“post”);
}
[/AS]

if you need help with CDONTS(asp mail object) let me know

here is a sample code that will uses CDONTS



<%
fn = Request.Form("fn")

Dim EmailFromAddress, EmailToAddress, Subject, Body, File

EmailFromAddress = "youremail"
EmailToAddress = "youremail"
Subject = "Test"
Body = Request.Form("comments")& Request.Form("em")

Set MailObj = Server.CreateObject("CDONTS.NewMail")
MailObj.BodyFormat =  1
MailObj.MailFormat = 0
MailObj.Send EmailFromAddress, EmailToAddress, Subject, Body, File

Response.Write "Thank You, Your Message Has Been Sent"

%>

I must be doing something wrong. Here is the AS that I’m using.
stop();

myCheck = [rvc,trs,mavc,vds,dmcs];
function checkDisplay(component) {
var j,s;
for(j in myCheck){
if(myCheck[j].getValue()) s += myCheck[j].getLabel()+"
";
}
checke="You like:
" + ((s.length) ? s : “Nothing”);
}
for (i=0;i<myCheck.length;i++) {
myCheck*.setChangeHandler (“checkDisplay”) ;
}
_root.bar._visible=false;
// onChanged function
comment.onChanged = function(){
if (this.maxscroll>1) {
_root.bar._visible=true;
}
else _root.bar._visible=false;
}
onReset = function () {
// checkbox
var j;
for (j in myCheck) {
myCheck[j].setValue(false);
}
// text
name.text = “”;
mail.text = “”;
address.text = “”;
city.text = “”;
state.text = “”;
zip.text = “”;
phone.text = “”;
comment.text = “”;
bar._visible = false;

your not submitting your values to the asp page. where is the actions for your submit button?

I put the AS you told me to use at the bottom but it still doesn’t work.

I have the variables on a separate layer, this is what they look like:

formData = new LoadVars ();
formData.name = “”;
formData.email = “”;
formData.address = “”;
formData.city = “”;
formData.state = “”;
formData.zip = “”;
formData.phone = “”;
formData.rvc = “”;
formData.trs = “”;
formData.vds = “”;
formData.mavc = “”;
formData.dmcs = “”;
formData.comment = “”;

replyData = new LoadVars ();
replyData.onLoad = myOnLoad;

I was thinking maybe I should put them on the same layer before the “submit.onRelease function” or after. I’m totally confused.

Here is a copy of the ASP I am using:

<%
Name = Request.form(“name”)
Email = Request.form(“email”)
Address = Request.form(“address”)
City = Request.form(“city”)
State = Request.form(“state”)
Zip = Request.form(“zip”)
Phone = Request.form(“phone”)
Rvc = Request.form(“rvc”)
Trs = Request.form(“trs”)
Vds = Request.form(“vds”)
Mavc = Request.form(“mavc”)
Dmcs = Request.form(“dmcs”)
Comment = Request.form(“comment”)

strName = “clients name”
strEmail = "clientsname@clientscompany.com"

strSubject = “Example Email”
strBody = Name & Email & Address & City & State & Zip & Phone & RVC & TRS & VDS & MAVC & DMCS & Comment

Set Mailer = Server.CreateObject(“SMTPsvg.Mailer”)
Mailer.RemoteHost = “smtp.clientscompany.com
Mailer.FromName = Name
Mailer.FromEmail = Email
Mailer.FromAddress = Address
Mailer.FromCity = City
Mailer.FromState = State
Mailer.FromZip = Zip
Mailer.FromPhone = Phone
Mailer.FromRVC = rvc
Mailer.FromTRS = trs
Mailer.FromVDS = vds
Mailer.FromMAVC = mavc
Mailer.FromDMCS = dmcs
Mailer.FromComment = Comment
Mailer.AddRecipient strName, strEmail
Mailer.Subject = (strSubject)
Mailer.BodyText = strBody

if Mailer.SendMail then
Response.Write “_root.Mail.EmailStatus=Complete - Your mail has been sent”
else
Response.Write “_root.Mail.EmailStatus=Failure - Your mail was not sent - errors”
Response.Write Mailer.Response
end if
%>

I’m not sure what “CDONTS” are.

Sorry, that didn’t post right, I’ll try again:

<%
Name = Request.form(“name”)
Email = Request.form(“email”)
Address = Request.form(“address”)
City = Request.form(“city”)
State = Request.form(“state”)
Zip = Request.form(“zip”)
Phone = Request.form(“phone”)
Rvc = Request.form(“rvc”)
Trs = Request.form(“trs”)
Vds = Request.form(“vds”)
Mavc = Request.form(“mavc”)
Dmcs = Request.form(“dmcs”)
Comment = Request.form(“comment”)

strName = “Neil Flynn”
strEmail = "neilflynn@redkoh.com"

strSubject = “Example Email”
strBody = Name & Email & Address & City & State & Zip & Phone & RVC & TRS & VDS & MAVC & DMCS & Comment

Set Mailer = Server.CreateObject(“SMTPsvg.Mailer”)
Mailer.RemoteHost = “smtp.redkoh.com
Mailer.FromName = Name
Mailer.FromEmail = Email
Mailer.FromAddress = Address
Mailer.FromCity = City
Mailer.FromState = State
Mailer.FromZip = Zip
Mailer.FromPhone = Phone
Mailer.FromRVC = rvc
Mailer.FromTRS = trs
Mailer.FromVDS = vds
Mailer.FromMAVC = mavc
Mailer.FromDMCS = dmcs
Mailer.FromComment = Comment
Mailer.AddRecipient strName, strEmail
Mailer.Subject = (strSubject)
Mailer.BodyText = strBody

if Mailer.SendMail then
Response.Write “_root.Mail.EmailStatus=Complete - Your mail has been sent”
else
Response.Write “_root.Mail.EmailStatus=Failure - Your mail was not sent - errors”
Response.Write Mailer.Response
end if
%>

In the Tutorial the submit button is a movie clip, so I put the AS for it at the bottom of the AS that I posted above. I’m going to leave something out of the ASP file so I can post it here:

Name = Request.form(“name”)
Email = Request.form(“email”)
Address = Request.form(“address”)
City = Request.form(“city”)
State = Request.form(“state”)
Zip = Request.form(“zip”)
Phone = Request.form(“phone”)
Rvc = Request.form(“rvc”)
Trs = Request.form(“trs”)
Vds = Request.form(“vds”)
Mavc = Request.form(“mavc”)
Dmcs = Request.form(“dmcs”)
Comment = Request.form(“comment”)

strName = “clientsname”
strEmail = "clientsname@clientscompany.com"

strSubject = “Example Email”
strBody = Name & Email & Address & City & State & Zip & Phone & RVC & TRS & VDS & MAVC & DMCS & Comment

Set Mailer = Server.CreateObject(“SMTPsvg.Mailer”)
Mailer.RemoteHost = “smtp.clientscompany.com
Mailer.FromName = Name
Mailer.FromEmail = Email
Mailer.FromAddress = Address
Mailer.FromCity = City
Mailer.FromState = State
Mailer.FromZip = Zip
Mailer.FromPhone = Phone
Mailer.FromRVC = rvc
Mailer.FromTRS = trs
Mailer.FromVDS = vds
Mailer.FromMAVC = mavc
Mailer.FromDMCS = dmcs
Mailer.FromComment = Comment
Mailer.AddRecipient strName, strEmail
Mailer.Subject = (strSubject)
Mailer.BodyText = strBody

if Mailer.SendMail then
Response.Write “_root.Mail.EmailStatus=Complete - Your mail has been sent”
else
Response.Write “_root.Mail.EmailStatus=Failure - Your mail was not sent - errors”
Response.Write Mailer.Response
end if

I left the brackets out purposly, I hope you can see it now.

i am not familiar with that code, your using smtp, let me cook up a little tute for you, ill do it by tonight

if Mailer.SendMail then
Response.Write “_root.Mail.EmailStatus=Complete - Your mail has been sent”
else
Response.Write “_root.Mail.EmailStatus=Failure - Your mail was not sent - errors”
Response.Write Mailer.Response
end if

is that flash code in an asp page??? if not your code is way off, you cant do that with asp

these guys pretty much cant explain it any better. i think ur confuing the flash and asp code

http://www.webthang.co.uk/tuts/tuts_fmx/gfmx4/gfmx4_1.asp

Any luck?

I think so, but, I’m not sure - I had the ASP page all wrong. (I guess you knew that!!). I have it running - it’s going to the ASP page, but, I’m not sure if all the information is getting there or not. I’m going to change the email address to my own and fill out the form to see what I get.

I’ll let you know - and I thanks for all the help you have been giving me, I really appreciate it!

yea no prob, real quick though:

i hope you know you can not just run an asp page from it’s current location. you need to configure IIS (Internet Information Server) it’s stored under admin options on your start menu. also you will need to configure your SMTP mail server on your machine. I woudl consider signing up for a free account with brinkster http://www.brinkster.com just to et it working then configure yourw own machine. also i windows millinium doesn’t support IIS :slight_smile: Hope you know what i am talking about, if not let me know and I will explain further.

and im hope im not insulting ur intelligence, just trying to get you set up.

to run an asp file go tto your browser and type
http://localhost/yourpage.asp

run a quick test to see if it’s configured. create an asp page and apply this code


<% response.write "Test" %>

when you call the page as i advised if you dont see test, you don’t have IIS configured properly or you might not have it installed

Not a problem - believe me, I am completely new to “ASP” stuff so my intelligence is if anything - IMPROVING!! LOL

I installed IIS, but I’m not sure if I configured it the right way. I don’t see the test you told me to try.

I installed IIS. The “Personal Web Manager” is up. I created a “default.asp” and saved it in: Inetpub/wwwroot this is what the default.asp page looks like:

<%
fn = Request.Form(“fn”)

Dim EmailFromAddress, EmailToAddress, Subject, Body, File

EmailFromAddress = “youremail”
EmailToAddress = “youremail”
Subject = “Test”
Body = Request.Form(“comments”)& Request.Form(“em”)

Set MailObj = Server.CreateObject(“CDONTS.NewMail”)
MailObj.BodyFormat = 1
MailObj.MailFormat = 0
MailObj.Send EmailFromAddress, EmailToAddress, Subject, Body, File

Response.Write “Thank You, Your Message Has Been Sent”

I have the Personal Web Manager up it still shows me the name of my computer - I must have done something wrong cuz I thought that it was supposed to change?

I’m not sure what to change in the “Advanced Tab”.

ok let’s start from the beginning. Do this

Right click on toolbar next to your start menu
Go to properties>>start menu>>customize
click display administrative tools. ( I am on xp your might be a bit different)
click apply and close the properties box

then go to your start menu>>programs>>admin tools>>IIS

once IIS is open expand the tree

go to wesites>>default website>>right click>>properties

Leave everything as is, make the port 80

execute permissions should be scripts and executables

go to home directory and defien your local path(your web folder)

grant all permissions for now just to test

now your done configuring IIS

open notepad and save this file as “test.asp”


<%@ Language = "VBScript" %>
<% Response.Write "This is a test" %>

make sure that file is in your local path that you earlier defined.

type in your browser

http://localhost/test.asp

but if Inetpub/wwwroot isnt you’r defined path make sure to include the true path

there ya go that should do it, when you go to that page that you made you should see the words “This is a test”.

I’ll look at your script

this code takes three variables from flash and sends it to a specified email


<% @language="VBSCRIPT" %>

<%

	Dim myMail, myBody
        
        myBody = "Name: "& request.form("name") & vbcrlf
        myBody = myBody & "Email: "& request.form("email") & vbcrlf
        myBody = myBody & "Message: "& vbcrlf & request.form("message")

	Set myMail = CreateObject("CDONTS.NewMail")

	myMail.BodyFormat=1
	myMail.MailFormat=1
	myMail.From=request.form("email")
	myMail.To=request.form("email")
	myMail.Subject="Flash MX Basic Email"
	myMail.Body=myBody
	myMail.Send

	set myMail=nothing

%>

save that file as “mail.asp”

create 3 text fields in flash

variables are

name
email
message

subit button actions
[AS]
on (release) {
getURL(“mail.asp”, “”, “POST”);
}
[/AS]

this code works, i tryed it

oh and not to kill it but this only worked on my web server. i dont have my smtp configured properly

The test worked. I am on the right track with that. I have a question. I have my Variables on a separate layer then my Action Script in Flash, could this be causing the problem?

Here is a copy of the ASP page that I created with the added variables that I need. I’m not sure if I entered them right or not.

<% @language=“VBSCRIPT” %>

<%

Dim myMail, myBody
myBody = "Name: "& request.form(“name”) & vbcrlf
myBody = myBody & "Email: "& request.form(“email”) & vbcrlf
myBody = myBody & "Address: "& request.form(“address”) & vbcrlf
myBody = myBody & "City: "& request.form(“city”) & vbcrlf
myBody = myBody & "State: "& request.form(“state”) & vbcrlf
myBody = myBody & "Zip: "& request.form(“zip”) & vbcrlf
myBody = myBody & "Phone: "& request.form(“phone”) & vbcrlf
myBody = myBody & "rvc: "& request.form(“rvc”) & vbcrlf
myBody = myBody & "trs: "& request.form(“trs”) & vbcrlf
myBody = myBody & "vds: "& request.form(“vds”) & vbcrlf
myBody = myBody & "mavc: "& request.form(“mavc”) & vbcrlf
myBody = myBody & "dmcs: "& request.form(“dmcs”) & vbcrlf
myBody = myBody & "Comment: "& vbcrlf & request.form(“comment”)

Set myMail = CreateObject(“CDONTS.NewMail”)

myMail.BodyFormat=1
myMail.MailFormat=1
myMail.From=request.form("email")
myMail.To="alleenb@optonline.net"
myMail.Subject="Flash MX Basic Email"
myMail.Body=myBody
myMail.Send

set myMail=nothing

When I press the submit button after filling out the form, it says the message is sent, but I don’t receive the email. When I did yours - it worked. I think I’m still not doing something right. Maybe it’s the way I have my variables, this is what they look like and like I said before, they are on their own layer in Flash.

formData = new LoadVars ();
formData.name = “”;
formData.email = “”;
formData.address = “”;
formData.city = “”;
formData.state = “”;
formData.zip = “”;
formData.phone = “”;
formData.rvc = “”;
formData.trs = “”;
formData.vds = “”;
formData.mavc = “”;
formData.dmcs = “”;
formData.comment = “”;

replyData = new LoadVars ();
replyData.onLoad = myOnLoad;

This is driving me crazy…and by now…maybe you, I’m sorry for being such a pain in the butt. I really appreciate all that you have done for me.

Thanks again!

errrr, im not sure what happened to that long explanation i gave went, did soemone delete it?

anywho, you don’t need to do that. just set your variables in your properties panel, and on your submit button

[AS]
on(release){
getURL(“yourpage.asp”,0,“post”);
}
[/AS]

thats it. why dotn you attach both your files, so I can take a look.

oh and I don’t mind, our servers are down today woOt!!!