PDA

View Full Version : getting data from input-form into email; what's wrong with my script? Thanks!


creamroyale
02-13-2001, 11:26 PM
hi!

I try now for hours to build a simple email-form for my flash-site. (my server doesn't support CGI or PHP or something, I think, and I don't have time to find out)

I did it exactly as described in one of Macromedia's tutorials:

I made two input-textfields, one named "varsubject" and one "varbody". then a button with following script attached:

mailto:[email protected]?subject="&varsubject&"&body="&varbody

however I never get anything into my email's subject or body?

thanks a lot for any help!!

Jesse
02-14-2001, 01:25 AM
Flash 5? That's flash 4 syntax. Use + in place of the &'s there.

Change that code to:

"mailto:[email protected]?subject=" + varsubject + "&body=" + varbody

My example here works:

on (release) {
emailAddy = "[email protected]";
getURL ("mailto:" + emailAddy +"?subject=Test&body=" + body);
}


Cheers

Jesse

creamroyale
02-14-2001, 07:10 AM
First of all, thanks a lot Jesse!

I changed my code now to:
"mailto:[email protected]?subject=" + varsubject + "&body=" + varbody

and it works, HOWEVER in my email theres not only the text typed in by the user but also html-tags.
so in the email it looks like this:

<P ALIGN="LEFT"><FONT FACE="arial" SIZE="10" COLOR="#000000"></FONT></P><P ALIGN="LEFT"><FONT FACE="arial" SIZE="10" COLOR="#000000">BODYTEST, BODYTEST ODYTEST, BODYTESTODYTEST, BODYTESTODYTEST, </FONT></P><P ALIGN="LEFT">

??

moreover it always opens either IE or Netscape, if I want to send the email!

thanks again!!!

Jesse
02-14-2001, 07:39 AM
Yeah umm I don't thin kthat's avoidable...

I did:

bodyString = "<P ALIGN=\"LEFT\"><FONT FACE=\"arial\" SIZE=\"10\" COLOR=\"#000000\"></FONT></P><P ALIGN=\"LEFT\"><FONT FACE=\"arial\" SIZE=\"10\" COLOR=\"#000000\">BODYTEST, BODYTEST ODYTEST, BODYTESTODYTEST, BODYTESTODYTEST, </FONT></P><P ALIGN=\"LEFT\">";
trace("mailto:[email protected]?body="+bodyString);
getURL ("mailto:[email protected]?body="+bodyString);

If you view the trace() it outputs exactly the string you want but it DOES open in IE. Which isn't what you want. Only other option would be to try using the ASCII values for all special characters ( /, >, <, #, etc) but I don't think even that will work. If you want formatted email you really need to use server side scripts. Apart from anything else, users who use Hotmail and the like wont be able to send you this email because they use a 'net based email provider and not a POP based one.

Cheers

Jesse

creamroyale
02-14-2001, 12:34 PM
thanks Jesse,

in that case however I'd rather make a ordinary html-popup window with a form or something.

chris

GoodLook
04-28-2001, 04:48 PM
i found a treath, it works but....

on (release) {
emailAddy = "[email protected]";
getURL
("mailto:"+emailAddy+"?subject=Test&body=subscribe hoe");
}

the body text "subscribe hoe" is not correct in the mail,
the space is gone and its in RTF format and not in plain text.

what to do?

thanks,
The belgium

Jesse
04-29-2001, 07:05 AM
on (release) {
emailAddy = "[email protected]";
getURL
("mailto:"+emailAddy+"?subject=Test&body=subscribe%20hoe");
}

Try that.

Cheers

Jesse

ayuthere
07-30-2001, 08:43 PM
i have a flash site that needs to return the contact section to the client through our CGI script. the get URL action calling the absolute path of the CGI script would be fine but , how can i specify the values it needs such as "recipient" or "subject" as well as all the fields in the form?

thanks,

Jesse
07-31-2001, 04:14 AM
you set them as variables within flash.