Im not sure about AS3, but this is how it's done in AS2:
ps. Flash cannot do this alone, so you need a server that supports PHP.
Code:
submit.onRelease = function(){
var email_lv:LoadVars = new LoadVars();
var email_reciever:LoadVars = new LoadVars();
email_lv.eName = input_name.text; //The input field for name
email_lv.eMail = input_email.text; //The input field for email (The user's email that is)
email_lv.eSubject = input_subject.text; //The input field for subject
email_lv.eMessage = input_message.text; //The input field for message
email_reciever.onLoad = function(success:Boolean){
if(success){
statusField.text = "The email was sent!";
} else {
statusField.text = "The email was NOT sent!";
}
}
email_lv.sendAndLoad("sender.php",email_reciever,"POST");
}
And your 'sender.php' file:
PHP Code:
<?
$name = $_POST["eName"];
$email = $_POST["eMail"];
$subject = $_POST["eSubject"];
$message = $_POST["eMessage"];
mail("nameofthesite@gmail.com", $subject, $message, "From: $name <$email>");
?>