# Flash \> php \> email

**URL:** <https://forum.kirupa.com/t/flash-php-email/227303>\
**Category:** Uncategorized\
**Created:** [May 29, 2007, 9:02am UTC](https://forum.kirupa.com/t/flash-php-email/227303 "2007-05-29T09:02:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [May 29, 2007, 9:02am UTC](https://forum.kirupa.com/t/flash-php-email/227303/1 "2007-05-29T09:02:11Z")

</div>

hi there,

I am trying so create an email function in flash… and my php is as follows …  
For starters - Is this php correct!? The flash file is sendAndLoad 'ing the variables ‘name\_txt’ etc…  
\<?php

$to = "jeancnicolas@yahoo.co.uk";  
$subject = “Message From Website”;  
$name\_txt = $\_POST[‘name\_txt’];  
$email\_txt = $\_POST[‘email\_txt’];  
$message\_txt = $\_POST[‘message\_txt’];

$body = “From: $name\_txt  
E-Mail: $email\_txt  
Message:  
$message\_txt”;

echo “confirmation=true”;  
mail($to, $subject, $body);

?\>

and my AS for my flash send button is:  
send\_btn.onRelease = function (){

```
var sender:LoadVars = new LoadVars();

sender.name_txt = name_txt.text;
sender.email_txt = email_txt.text;
sender.message_txt = message_txt.text;

var receiver:LoadVars = new LoadVars();
sender.sendAndLoad("email.php",receiver);
trace (sender);

receiver.onLoad = function(success:Boolean){
    if(!success){
        error_txt.text = "Connection Failed";
        return;
    }
    
    if( receiver.confirmation == "true" ){
        error_txt.text = "Thank You";
    }
    else {
        error_txt.text = "Sorry The Message Failed To Send"
    }
}

```

}

Can anyone seey where I am going wrong!?  
As it doesn’t work!  
(P.s. My server does support PHP!)

THANKYOU!!!
