Hello,
I’ve found several posts / threads on creating email forms. I uploaded both the Kirupa email form and another email form from
Neither worked for me and the only thing I changed was the email address. Wondering how to test why the email’s not getting to me? Am I forgetting something?
Anyone help me get either working, please??
http://developdesign.com/samples/phpflashmail/Kirupa_flash_php_email.html
Actionscript on flash button:
on (release) {
// send variables in form movieclip (the textfields)
// to email PHP page which will send the mail
form.loadVariables("email.php", "POST");
}
PHP code
<?php
/***************************************************\
* PHP 4.1.0+ version of email script. For more
* information on the mail() function for PHP, see
* http://www.php.net/manual/en/function.mail.php
\***************************************************/
// First, set up some variables to serve you in
// getting an email. This includes the email this is
// sent to (yours) and what the subject of this email
// should be. It's a good idea to choose your own
// subject instead of allowing the user to. This will
// help prevent spam filters from snatching this email
// out from under your nose when something unusual is put.
$sendTo = "jonathan@developdesign.com";
$subject = "My Flash site reply";
// variables are sent to this PHP page through
// the POST method. $_POST is a global associative array
// of variables passed through this method. From that, we
// can get the values sent to this page from Flash and
// assign them to appropriate variables which can be used
// in the PHP mail() function.
// header information not including sendTo and Subject
// these all go in one variable. First, include From:
$headers = "From: " . $_POST["firstName"] ." ". $_POST["lastname"] . "<" . $_POST["email"] .">
";
// next include a replyto
$headers .= "Reply-To: " . $_POST["email"] . "
";
// often email servers won't allow emails to be sent to
// domains other than their own. The return path here will
// often lift that restriction so, for instance, you could send
// email to a hotmail account. (hosting provider settings may vary)
// technically bounced email is supposed to go to the return-path email
$headers .= "Return-path: " . $_POST["email"];
// now we can add the content of the message to a body variable
$message = $_POST["message"];
// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $message, $headers);
?>
Second tutorial: http://www.layoutgalaxy.com/html/htmnewletter55-page2.htm
http://developdesign.com/samples/phpflashmail/form.html
Actionscript code
stop();
// Making the default setting for below mentioned textfields
name = "";
email = "";
suggestion = "";
//
//-------------------------------------------------------
// Submit Button action
submit.onRelease = function() {
//Add Path of the php file
feedbackpath = "mailto.php";
//
str1 = email.indexOf("@");
str2 = email.indexOf("@")+1;
str3 = email.charAt(str1+1);
str4 = email.lastIndexOf(".");
str5 = email.charAt(str4+1);
len = length(email);
counter = 1;
flag = 0;
while (Number(counter)<=Number(len)) {
Char = substring(email, counter, 1);
if (Char ne "@") {
flag = Number(flag)+1;
}
counter = Number(counter)+1;
}
//
//Name field validation
if (name == "") {
condition1 = "";
namemark._visible = true;
} else {
condition1 = "ok";
namemark._visible = false;
}
//E-Mail Address validation
if (str4<=str2 || str3 == "." || str5 == "" || Number(flag) != Number(len-1)) {
condition2 = "";
emailmark._visible = true;
} else {
condition2 = "ok";
emailmark._visible = false;
}
//Suggestion field validation
if (suggestion == "") {
condition3 = "";
suggestionmark._visible = true;
} else {
condition3 = "ok";
suggestionmark._visible = false;
}
//Sending data to php file only if all the above validations are fulfilled
if (condition1 == "ok" && condition2 == "ok" && condition3 == "ok") {
loadVariablesNum(feedbackpath+"?name="+name+"&email="+email+"&feedback="+suggestion, 0);
gotoAndStop(2);
}
};
//
//-------------------------------------------------------
// Reset Button action
reset.onRelease = function() {
// Making the default setting for below mentioned textfields
name = "";
email = "";
suggestion = "";
// Making '*' Marks Invisible
namemark._visible = false;
emailmark._visible = false;
suggestionmark._visible = false;
};
PHP code
<?
//Destination Email ID
$to = "jonathan@developdesign.com";
//Name of the Person
$namenew = $_GET['name'];
//Email Id of the person
$emailnew = $_GET['email'];
//Feedback detail
$feedbacknew = $_GET['feedback'];
//Subject line of the email
$subject = "Feedback Form"." "."$emailnew";
/*********** Email body *******************/
$matter = "Below are the details filled by"." "."$namenew"."
".
"Name:"." "."$namenew"."
".
"Email:"." "."$emailnew"."
".
"Suggestion:"." "."$feedbacknew"."
";
/**********************************************/
mail("$to", "$subject","$matter","From: $emailnew");
?>