Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chrono1081

macrumors G3
Original poster
Jan 26, 2008
8,450
4,148
Isla Nublar
Hi guys,

I am helping a friend work on a flash program (made in Flash CS5) and we are trying to find an easy way to email data from a text box to an email address without needing to use a php file. Is this possible?

Basically here is what I have:

I have four text boxes, I know how to get the text out of them so thats not a problem. I also have a send button that I can trace the contents of the text boxes after I click them. (So I know the data is being read correctly).

What I want to do is have it to when I click the "send" button the data in the four text boxes is automatically sent to an email address I specify. Is there a way to do this? Any help would be greatly appreciated :)


EDIT: I looked at the mailto command but it pops up my desktop mail client :( I'm trying to find a way where the data just clears off the text boxes and the data in them is sent.
 
Last edited:

chrono1081

macrumors G3
Original poster
Jan 26, 2008
8,450
4,148
Isla Nublar
You can use loadvars to pass the data to a php file... From there you can pass it to a database, email it, etc.

Google "flash php contact form" for some examples of this...

Thank you for the suggestion, unfortunately we can't use php :(

Do you know of a way to do this without php files by chance? From the tutorials I saw you have to have the flash website up and hosted and the host has to support it. The flash project won't be hosted on a site that can support php.
 

web_god61

macrumors regular
May 14, 2004
111
1
1) No, this is not possible as flash runs on the client and emails must be sent using the server (asp.net / php).

2) Every low-end garbage web hosts supports php. Unless your running on a free host, just pay the $3 a month.
 

chrono1081

macrumors G3
Original poster
Jan 26, 2008
8,450
4,148
Isla Nublar
1) No, this is not possible as flash runs on the client and emails must be sent using the server (asp.net / php).

2) Every low-end garbage web hosts supports php. Unless your running on a free host, just pay the $3 a month.

Thank you for letting me know its not possible. The website has to go up on Penn States servers which don't seem to support PHP for the section that students can upload to :/

We made a work around though by printing the data in the form to the output console that way the professor can see that the data was being read from the text boxes.
 

lucidmedia

macrumors 6502a
Oct 13, 2008
702
37
Wellington, New Zealand
Flash's security restrictions require you to have something running on the server to handle the data... if you cant use PHP you could go old-school and use CGI or some other server-side scripting.
 

web_god61

macrumors regular
May 14, 2004
111
1
^ if php is disabled, its safe to assume all scripting is disable for the same reason.

Glad you found a solution. Knowing more about your setup, if you still wanted to send an email, you can keep the server script on the professors account which may have scripting enabled. You only need one php file (and not one for every student) that every student can access from flash via post/get.

So if your scrip is at ...com/~professor_jack/emailer.php, in flash send a request to ..com/~professor_jack/emailer.php?email=email&val2=val.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.