Skip to main content
Participant
December 9, 2013
Question

emailing text from flash

  • December 9, 2013
  • 1 reply
  • 793 views

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

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
December 9, 2013

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

NORBSAuthor
Participant
December 9, 2013

oki!!!! am not good at php coding!!!!! i was thinking it was a simple script in flash!!!

can you help!!!

sinious
Legend
December 9, 2013

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.