# Flash form to email

**URL:** https://forum.kirupa.com/t/flash-form-to-email/320607
**Category:** flash
**Created:** [March 28, 2011, 1:01pm UTC](https://forum.kirupa.com/t/flash-form-to-email/320607 "2011-03-28T13:01:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Sendarrow](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Sendarrow](https://forum.kirupa.com/u/Sendarrow)
#### Post date: [March 28, 2011, 1:01pm UTC](https://forum.kirupa.com/t/flash-form-to-email/320607/1 "2011-03-28T13:01:18Z")

</div>

Hello all,

I have a Flash form done and I would like to connect it to an email. I’m a little confuse on how to do that.

I’ve read that I have to make a separate php page and uploaded with all my files, but I’m not clear yet.

Following is my code:

* * *

import flash.net.URLVariables;  
import flash.net.URLRequest;

InteractiveObject(theName.getChildAt(1)).tabIndex = 1;  
InteractiveObject(theEmail.getChildAt(1)).tabIndex = 2;  
InteractiveObject(theMessage.getChildAt(1)).tabIndex = 3;  
/\* Mouse Click Event  
Clicking on the specified symbol instance executes a function in which you can add your own custom code.

Instructions:

1. Add your custom code on a new line after the line that says “// Start your custom code” below.  
The code will execute when the symbol instance is clicked.  
\*/

send\_btn.addEventListener(MouseEvent.CLICK, fl\_MouseClickHandler);

function fl\_MouseClickHandler(event:MouseEvent):void  
{

```
if (theName.text == "" || theEmail.text == "" || theMessage.text == "" ){
	theFeedback.text = "Please fill out all fields.";
}
else{
// create a variable container
	var allVars:URLVariables = new URLVariables();
allVars.name = theName.text;
allVars.email = theEmail.text;
allVars.message = theMessage.text;
//send info to a url
var mailAddress:URLRequest = new URLRequest("I dont know what to put here");
			mailAddress.data = allVars;
			mailAddress.method = URLRequestMethod.POST;
			sendToURL(mailAddress);
	theFeedback.text = "Thank you!";
	theName.text = "";
	theEmail.text = "";
	theMessage.text = "";
}

```

}

* * *

On the “I dont know what to put here” is where I have the problem.

Thanks for reading!
