Hi,
I recently created a flash AS3 email form from a popular tutorial for a website I’m creating and I have it working fine (thanks to some great help here). The problem I have now is that when I read the email posted from that website the ‘From:’ field does not contain the email address that the user entered. Instead I am seeing this… H-Sphere Httpd Daemon <httpd@web2.darklite.>** (asterisks added for security) which I assume is the mail daemon of the host where the website lives. Can anybody tell me how I can get the email ‘From:’ field to display the correct email address that the user enters ?
Here is the code from the fla file:
bSubmit.onRelease = function()
{
email();
}
function email()
{
var sMessage = "From: " + tName.text + "
E-mail: " + tEmail.text + "
Phone: " + tPhone.text + "
Comments: " + tMessage.text;
lvSend = new LoadVars();
lvReply = new LoadVars();
lvSend.msg = sMessage;
lvSend.address = "webmaster@****."; //Change this to your e-mail.
tStatus.text = “Sending Message…”;
tName.text = “”;
tEmail.text = “”;
tPhone.text = “”;
tMessage.text = “”;
lvReply.onLoad()
{
tStatus.text = “Thank You for your message.”;
}
lvSend.sendAndLoad(‘mail.php’, lvReply, ‘POST’);
}**
And here is the code from the php file:
<?php
$message = $_POST[“msg”];
$address = $_POST[“address”];
mail($address,“Website Message”,$message);
?>
Any help appreciated. Many Thanks.
BackHive