# Cant get contact mail form (done in Flash) to transfer data to my email address

**URL:** <https://forum.kirupa.com/t/cant-get-contact-mail-form-done-in-flash-to-transfer-data-to-my-email-address/317475>\
**Category:** flash\
**Created:** [December 22, 2010, 1:45am UTC](https://forum.kirupa.com/t/cant-get-contact-mail-form-done-in-flash-to-transfer-data-to-my-email-address/317475 "2010-12-22T01:45:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BondiBill](https://avatars.discourse-cdn.com/v4/letter/b/ecc23a/32.png) [@BondiBill](https://forum.kirupa.com/u/BondiBill)\
**Post date:** [December 22, 2010, 1:45am UTC](https://forum.kirupa.com/t/cant-get-contact-mail-form-done-in-flash-to-transfer-data-to-my-email-address/317475/1 "2010-12-22T01:45:15Z")

</div>

Hi all,  
A newbie at Flash but have created a contact form that sends 3 lots of data (name, email and message) to my email address.  
here is my code for my flash form which looks right

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.  
\*/  
sendBtn.addEventListener(MouseEvent.CLICK, fl\_MouseClickHandler\_5);  
function fl\_MouseClickHandler\_5(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(“[http://www.mydomainname.com/php.php](http://www.mydomainname.com/php.php)”);  
mailAddress.data = allVars;  
mailAddress.method = URLRequestMethod.POST;  
sendToURL(mailAddress);  
theFeedback.text = “Thank you!”;  
theName.text = “”;  
theEmail.text = “”;  
theMessage.text = “”;  
}  
}

here is my php page called php.php and it sends an email thru but the data is missing i.e. name, email, mesage $subject comes through and $body minus the data  
[COLOR=red]\<?php[/COLOR]  
[COLOR=red]$name = $\_POST[“allVars.name”];[/COLOR]  
[COLOR=red]$email = $\_POST[“allVars.email”];[/COLOR]  
[COLOR=red]$message = $\_POST[“allVars.message”];[/COLOR]  
[COLOR=red]$subject = “Contact Information”;[/COLOR]  
[COLOR=red]$headers = “from: $email”;[/COLOR]  
[COLOR=red]$emailto = “[/COLOR][[COLOR=red]myemailaddress[/COLOR]](mailto:bck@stac.school.nz)[COLOR=red]”;[/COLOR]  
[COLOR=red]$body = “The person who filled out [/COLOR]  
[COLOR=red]this contact form was called $name  
[/COLOR]  
[COLOR=red]Their email address is $email  
[/COLOR]  
[COLOR=red]and their message is $message”;[/COLOR]  
[COLOR=red]Mail ($emailto, $subject, $body, $headers);[/COLOR]  
[COLOR=red]?\>[/COLOR]

[COLOR=black]Any help would gladly be appreciated Cheers BondiBill[/COLOR]
