View Full Version : ASP send via POST not sending vars

11-06-2003, 06:50 PM
Hello all... I come grovelling in search of what is probably a fairly elementary answer...

I have been trying for days to pass info from Flash 2004 to an ASPmail script.

When I submit the following code, a new window opens with the variable name and pairs show in the URL... which I thought was only supposed to happen with a "GET" command, not "POST".

e.g. -- http://www.maxxquest.com/thur/mailer6.asp?fromaddress=abc%40123%2Ecom&fromname=John
(mouse over this to see the whole url in the status bar)

Either way, the script returns an error saying that necessary fields are blank.

All of my fields are on a single layer with no movie clips or other embedding... the two fields I'm trying to send are 'fromname' and fromaddress'

here's the actionscript for the submit button:

on (release) {
var mailtest = new LoadVars();
mailtest.fromname = fromname.text;
mailtest.fromaddress = fromaddress.text;
mailtest.send("mailer6.asp", "_blank", "POST");

here's the ASP script:

<title>11/05/03 - 12:23PM</title>

<body bgcolor="white">
<h3><font face="arial">Thank You</font></h3>


Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = Request.Form("fromname")
Mailer.FromAddress= Request.Form("fromaddress")
Mailer.RemoteHost = "www.server.com"
Mailer.AddRecipient "John Doe", "[email protected]"
Mailer.Subject = "Form Submission"

strMsgHeader = "Form information follows" & vbCrLf

for each qryItem in Request.Form
strMsgInfo = strMsgInfo & qryItem & " - " & request.Form(qryItem) & vbCrLf

strMsgFooter = vbCrLf & "End of form information"
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter

if Mailer.SendMail then
Response.Write "Form information submitted..."
Response.Write "Mail send failure. Error was " & Mailer.Response
end if



I don't need any response to be sent back to the flash movie, just the confirmation from the script in the new HTML window...

Please, please, please... can anyone shed some light on this... I've researched every tutorial and movie I can find... all with no luck.

Thanks again in advance,

11-06-2003, 08:18 PM

You say (and show) that the variables are being sent via GET, although you specify POST.
Are you testing this on an html page?
Because if you use the standanlone player, or the test-movie player, they can't send variables via POST, and always use GET.

I don't know anything about asp, but in php and coldfusion you may specify that the variable have to be loaded via POST or GET.
If you specifyed POST in this script, that may be the reason.

11-07-2003, 10:29 AM
thank you, thank you, thank you... (i could fill the page with thank-yous!!)

i had assumed since it was communicating with the script and returning something that the 'Test Movie' option would allow me to run those commands... I had no idea it wouldn't accept 'POST'... all works like a charm now.

Thanks yet again...

12-08-2003, 03:32 PM
solved my problem too! thanks!! (didn't know POST won't work under test movie mode)