Capture email address from textInput field and send an email to it

Hello

I have a little mini game / app, that basically spins a wheel of fortune when the user clicks and drags the mouse. Once the wheel slows down and stops it displays the resulting prize in a dynamic text box. If the user spins again the dynamic text box is cleared and a new prize is shown depending on the spin result. So far so good.

Now elsewhere I have 3 textInput fields - where I want the user to enter their name, last name and email address.

Here is the catch, I need the SWF to email the result from the dynamic textbox to the email address that is entered into the email text field by the user.

I have found many php / AS3 form solutions that capture some input etc but all the ones I found email to a specific address specified in the PHP file. How can I make it email the email address specified at runtime in the textInput field? Is it possible to make the

$to = [COLOR=#800000]“emailaddress@whatever.com”[/COLOR];

an actual variable, being the instance name of the textInput field in the FLA?

So basically user enters their name, last name and email address into 3 separate textInput fields.
He/she spins the wheel, result gets shown in the dynamic text field (instance name : result) AND an email gets sent to the inputted email address, saying the following :

Good day <name> <last name>,

<result>

Any help would be greatly appreciated.