Copy link to clipboard
Copied
Hi everyone. I am creating an application in flash. I want to add a functionality, which allows the user to send text from the flash to his/her email address. How can this be done? Please note that the text would be a movie clip Help on an urgent basis would be greatly appreciated Thanks
Copy link to clipboard
Copied
Normally emailing will utilize a server-side script to process the data and send the email. PHP is a common server-side langage for this purpose. So Flash would send the data to the PHP file and the PHP file would process that data into an email which it sends. Search Google using terms like "AS3 PHP email tutorial" to find some examples
Copy link to clipboard
Copied
oki!!!! am not good at php coding!!!!! i was thinking it was a simple script in flash!!!
can you help!!!
Copy link to clipboard
Copied
Be very careful what you allow to be sent to your script. Most of those tutorials do not go over basics like injection. If you follow some tutorial like this which seems exactly like what you wish, they don't do any sanitization on the data being send. That opens the doors for people to hijack your form and inject data.
For example, either Flash or the server-side script (PHP/ASP/etc) needs to validate each piece of information.
One example is validating that you have a proper email address and the user is not trying to inject extra email addresses. A simple example would be using a regular expression in Flash to validate the email. Quickly:
e.g. (email_txt would be a TextField on screen to enter an email in):
if (!email_txt.text.toString().match(/^[\w.-]+@\w[\w.-]+\.[\w.-]*[a-z]{2,3}$/i))
{
// invalid email, didn't match check, warn user...
}
If you don't check, someone could piggy back another email address on there, e.g.: me@somewhere.com; someonelse@somewherelse.com; morepeople@moreplaces.com.. Then your script can be hijacked and used for spam purposes, or worse..
Just be careful.
Copy link to clipboard
Copied
I want to add a functionality, which allows the user to send text from the flash to his/her email address. not to my email add
Copy link to clipboard
Copied
Which means you must provide them with a way to specify their email. What a malicious user could do is specify 5000 emails separated by a semicolon and if your app is not checking the validity of what the user enters as their own e-mail then it will dutifully send out 5000 emails. This happens any time you give the user the ability to input data. You must minimize the risk that they're tampering with your system by validating their input.
Copy link to clipboard
Copied
please advise accordingly; note also that the application will run on a kioske!!!! and i think it wont happen that user do so!!!!
if you have any solution please send me!!!!
Copy link to clipboard
Copied
If it's a kiosk then you have another potential obstacle, internet availability. If your kiosk cannot connect to the internet to send the mail requests then you will need to devise an alternate strategy. One of many I've used is to accept input from the user, store it in the kiosk, retrieve the data stored at a later time and mass-send all the emails out at a later time from an internet connected machine.
The article I linked you to above will show you all you need to know about sending an email from AS3 to PHP. Just validate the user input, which most articles fail to cover.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now