-
1. Re: HELP Contact Page
kglad Jan 7, 2010 1:37 PM (in response to PrintingByDBE)you'll need to use server-side coding to send an email without opening the user's email client.
-
2. Re: HELP Contact Page
PrintingByDBE Jan 7, 2010 2:11 PM (in response to kglad)thanks for the reply!!
and do you know how i would do that!!
sry still new to flash n coding!!
-
3. Re: HELP Contact Page
kglad Jan 7, 2010 3:02 PM (in response to PrintingByDBE)first you have to find out what languages your server supports. start with php. does your server support php?
-
4. Re: HELP Contact Page
PrintingByDBE Jan 7, 2010 4:04 PM (in response to kglad)i am using Godaddy.com
to host my site...
-
5. Re: HELP Contact Page
kglad Jan 7, 2010 4:11 PM (in response to PrintingByDBE)in a plain text editor create file named emal.php and add the below code. you'll also need some code in your flash. are you using as2 or as3?
<?php
$emailRecipient = "your email address should go here";
$emailHeaders = "From: youremail@godaddy.com\r\nContent-type: text/html\r\n";
$emailHeaders .= "Reply-To: " .$_POST["userEmail"]. "\r\n";
$emailHeaders .= "\r\n";foreach ($_POST as $key => $value) {
$$key = stripslashes($value);
}$emailBody = "<HTML>
<BODY>
<TABLE BORDER='1'>
<TR>
<TD align='left' width='780'>Email : ".$userEmail."</TD>
</TR>
<TR>
<TD align='left' width='780'>Name : ".$userName."</TD>
</TR>
<TR>
<TD align='left' width='780'>Message: <br><br>".$userMessage."</TD>
</TR>
</TABLE>
</BODY>
</HTML>";if(mail($emailRecipient, "kglad Form\n\n", $emailBody, $emailHeaders)){
echo "var1=success";
} else {
echo "var1=failure";
}?>
-
6. Re: HELP Contact Page
PrintingByDBE Jan 7, 2010 4:15 PM (in response to kglad)im using Action Script 3
n Tnx
-
7. Re: HELP Contact Page
kglad Jan 7, 2010 5:59 PM (in response to PrintingByDBE)if you have input textfields userName, userEmail and userMessage, you can use the following in your flash:
var urlLdr:URLLoader = new URLLoader();
var urlReq:URLRequest = new URLRequest("email.php");
var urlVar:URLVariables=new URLVariables();
submitBtn.addEventListener(MouseEvent.CLICK,submitF);
function submitF(e:MouseEvent){
urlVar.userName = userName.text;
urlVar.userEmail = userEmail.text;
urlVar.userMessage = userMessage.text
urlReq.data=urlVar;
urlReq.method="POST";urlLdr.load(urlReq);
}
-
8. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 8:22 AM (in response to kglad)... WOW...
thanks for all the help KGLAD !!!
i will try it out now and i will let youknow how it works!!!
-
9. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 8:52 AM (in response to kglad)ok so i tried it..
the5150crew.com (contact page)
i havnt gotten errors but its not sending?
when i made the email.php
i opened text editor (mac)
then entered code and renamed the .txt to .php
does it have anything to do woith the .php code...
i didnt change ur code just copy n paste... (i highlighted areas maybe i should change?)
<?php
$emailRecipient = "your email address should go here";
$emailHeaders = "From: youremail@godaddy.com\r\nContent-type: text/html\r\n";
$emailHeaders .= "Reply-To: " .$_POST["userEmail"]. "\r\n";
$emailHeaders .= "\r\n";
foreach ($_POST as $key => $value) {
 $$key = stripslashes($value);
}
$emailBody = "<HTML>
<BODY>
<TABLE BORDER='1'>
<TR>
<TD align='left' width='780'>Email : ".$userEmail."</TD>
</TR>
<TR>
<TD align='left' width='780'>Name : ".$userName."</TD>
</TR>
<TR>
<TD align='left' width='780'>Message: <br><br>".$userMessage."</TD>
</TR>
</TABLE>
</BODY>
</HTML>";
if(mail($emailRecipient, "kglad Form\n\n", $emailBody, $emailHeaders)){
 echo "var1=success";
} else {
 echo "var1=failure";
}
?> -
10. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 9:02 AM (in response to kglad)thanks for the help!
-
11. Re: HELP Contact Page
kglad Jan 8, 2010 9:37 AM (in response to PrintingByDBE)you replaced the red code and have it all working now?
-
12. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 9:48 AM (in response to kglad)hmmm... ok so i changed the info in the .php ill show u...
im not sure about that red selection...
<?php
$emailRecipient = "admin@the5150crew.com";
$emailHeaders = "From: admin@the5150crew.com\r\nContent-type: text/html\r\n";
$emailHeaders .= "Reply-To: " .$_POST["userEmail"]. "\r\n";
$emailHeaders .= "\r\n";
foreach ($_POST as $key => $value) {
 $$key = stripslashes($value);
}
$emailBody = "<HTML>
<BODY>
<TABLE BORDER='1'>
<TR>
<TD align='left' width='780'>Email : ".$userEmail."</TD>
</TR>
<TR>
<TD align='left' width='780'>Name : ".$userName."</TD>
</TR>
<TR>
<TD align='left' width='780'>Message: <br><br>".$userMessage."</TD>
</TR>
</TABLE>
</BODY>
</HTML>";
if(mail($emailRecipient, "admin form\n\n", $emailBody, $emailHeaders)){
 echo "var1=success";
} else {
 echo "var1=failure";
}
?> -
13. Re: HELP Contact Page
kglad Jan 8, 2010 10:52 AM (in response to PrintingByDBE)i think that's ok but it's hard to read with the extraneous 

-
14. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 10:57 AM (in response to kglad)hmmmm i dont know what happened with all that extra "STUFF"
ill re-write ur code and try it again...
that was weird...
-
15. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 11:28 AM (in response to kglad)<?php
$emailRecipient = "admin@the5150crew.com";
$emailHeaders = "From: admin@the5150crew.com\r\nContent-type: text/html\r\n";
$emailHeaders .= "Reply-To: " .$_POST["userEmail"]. "\r\n";
$emailHeaders .= "\r\n";
foreach ($_POST as $key => $value) {
$$key = stripslashes($value);
}
$emailBody = "<HTML>
<BODY>
<TABLE BORDER='1'>
<TR>
<TD align='left' width='780'>Email : ".$userEmail."</TD>
</TR>
<TR>
<TD align='left' width='780'>Name : ".$userName."</TD>
</TR>
<TR>
<TD align='left' width='780'>Message: <br><br>".$userMessage."</TD>
</TR>
</TABLE>
</BODY>
</HTML>";
if(mail($emailRecipient, "Admin Form\n\n", $emailBody, $emailHeaders)){
echo "var1=success";
} else {
echo "var1=failure";
}
?> -
16. Re: HELP Contact Page
kglad Jan 8, 2010 12:22 PM (in response to PrintingByDBE)that looks good.
if it doesn't work, make sure your php file is named the same as the string used to call it in flash.
-
17. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 1:00 PM (in response to kglad)lol this is driving me crazy!!!
heres my flash code maybe u can see something wrong? PS THANKS FOR THE HELP LIKE ALWAYS!!!
var urlLdr:URLLoader = new URLLoader();
var urlReq:URLRequest = new URLRequest("email.php");
var urlVar:URLVariables=new URLVariables();
submitBtn.addEventListener(MouseEvent.CLICK,submitF);
function submitF(e:MouseEvent){
urlVar.Name = Name.text;
urlVar.Email = Email.text;
urlVar.Message = Message.text
urlReq.data=urlVar;
urlReq.method="POST";
urlLdr.load(urlReq);
}
HERES THE PHP (does it matter how i saved it cuz i just renamed it a .php instaed of .txt???
<?php
$emailRecipient = "admin@the5150crew.com";
$emailHeaders = "From: admin@the5150crew.com\r\nContent-type: text/html\r\n";
$emailHeaders .= "Reply-To: " .$_POST["userEmail"]. "\r\n";
$emailHeaders .= "\r\n";
foreach ($_POST as $key => $value) {
$$key = stripslashes($value);
}
$emailBody = "<HTML>
<BODY>
<TABLE BORDER='1'>
<TR>
<TD align='left' width='780'>Email : ".$userEmail."</TD>
</TR>
<TR>
<TD align='left' width='780'>Name : ".$userName."</TD>
</TR>
<TR>
<TD align='left' width='780'>Message: <br><br>".$userMessage."</TD>
</TR>
</TABLE>
</BODY>
</HTML>";
if(mail($emailRecipient, "Admin@the5150crew.com\n\n", $emailBody, $emailHeaders)){
echo "var1=success";
} else {
echo "var1=failure";
}
?> -
18. Re: HELP Contact Page
kglad Jan 8, 2010 1:23 PM (in response to PrintingByDBE)is the name of your php file email.php and is it in the same directory as your html and swf files? if so, what's the url to your html?
-
19. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 2:30 PM (in response to kglad)ok lemme see if i can answer your questions.. lol
the .php file is named email.php
as for the directorie!?
i use fetch to connect to the "server" and i just drop the files individually into there..?
and the url for my site is the5150crew.com!!!
I HOPE THIS HELPED
-
20. Re: HELP Contact Page
kglad Jan 8, 2010 3:21 PM (in response to PrintingByDBE)it doesn't look like your enter button does anything. is it supposed to?
-
21. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 3:23 PM (in response to kglad)well it should send the message!!
im guessing my links for the button are wrong...
-
22. Re: HELP Contact Page
kglad Jan 8, 2010 3:55 PM (in response to PrintingByDBE)show the code for your button.
-
23. Re: HELP Contact Page
PrintingByDBE Jan 8, 2010 5:09 PM (in response to kglad)hey Kglad heres all the coding on my contact page!!
it looks like i dont have any calls for the button??
HAVE A GREAT WEEKEND!!
var urlLdr:URLLoader = new URLLoader();var urlReq:URLRequest = new URLRequest("email.php");
var urlVar:URLVariables=new URLVariables();
submitBtn.addEventListener(MouseEvent.CLICK,submitF);
function submitF(e:MouseEvent){
urlVar.Name = Name.text;
urlVar.Email = Email.text;
urlVar.Message = Message.text
urlReq.data=urlVar;
urlReq.method="POST";urlLdr.load(urlReq);
}
-
24. Re: HELP Contact Page
kglad Jan 8, 2010 9:45 PM (in response to PrintingByDBE)somewhere you started to change my code. use:
var urlLdr:URLLoader = new URLLoader();
urlLdr.dataFormat=
URLLoaderDataFormat.VARIABLES;var urlReq:URLRequest = new URLRequest("email.php");
var urlVar:URLVariables=new URLVariables();
submitBtn.addEventListener(MouseEvent.CLICK,submitF);
function submitF(e:MouseEvent){
urlVar.userName = Name.text;
urlVar.userEmail = Email.text;
urlVar.userMessage = Message.text
urlReq.data=urlVar;
urlReq.method="POST";urlLdr.load(urlReq);
}
-
25. Re: HELP Contact Page
swif mcvay Jan 9, 2010 4:39 AM (in response to kglad)Hi
I seem to have a simliar problem,
I am hosting my site with spry.com
and am using a php form
<?php
$sendTo = "degrees28@hotmail.co.uk";
$subject = "Enquiry from Your Website";
$headers = "From: " . $_POST["name"] . "<" . $_POST["email"] .">\r\n";$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-path: " . $_POST["email"];
$message = "Company: " . $_POST["message"] . "\r\n" . "Subject: " . $_POST["message2"]. "\r\n" . "Message: " . $_POST["message3"];mail($sendTo, $subject, $message, $headers);
?>
but what happens is when i click on my form and fill in the fields, and click send, it doesnt clear the form and send the email,
I got hold of Spry.com and asked them if they supported PHP, for some reason they said they dont cause of spam??????
is there any other way to get my flash form to work????
Thanks
-
26. Re: HELP Contact Page
kglad Jan 9, 2010 7:14 AM (in response to swif mcvay)i responded to your thread. please don't continue posting in this thread.
-
27. Re: HELP Contact Page
PrintingByDBE Jan 11, 2010 9:05 AM (in response to kglad)Hello Kglad i hope you had a nice relaxing weekend!
i basically restarted... i copied your .php code again and the flash code i attached the codes in boxes ( to try to be neater ) and also attached the error message i got when i tried to "test the movie"
ALSO not sure if it helps but my text input fields are titled Name, Email, Message... Not userName, userEmail, userMessage
I ALSO ATTACHED AN IMAGE OF THE ERROR CODE BELOW
Flash Code var urlLdr:URLLoader = new URLLoader();
urlLdr.dataFormat=URLLoaderDataFormat.VARIABLES;
var urlReq:URLRequest = new URLRequest("email.php");
var urlVar:URLVariables=new URLVariables();
submitBtn.addEventListener(MouseEvent.CLICK,submitF);
function submitF(e:MouseEvent){
urlVar.userName = Name.text;
urlVar.userEmail = Email.text;
urlVar.userMessage = Message.text
urlReq.data=urlVar;
urlReq.method="POST";
urlLdr.load(urlReq);
}PHP CODE here is the email.php - still have no clue what the admin Form is or does? i just changed kglad Form to admin Form?
if(mail($emailRecipient, "admin Form\n\n", $emailBody, $emailHeaders)){
<?php
$emailRecipient = "admin@the5150crew.com";
$emailHeaders = "From: admin@the5150crew.com\r\nContent-type: text/html\r\n";
$emailHeaders = "Reply-To: " .$_POST["userEmail"]. "\r\n";
$emailHeaders = "\r\n";foreach ($_POST as $key => $value) {
$$key = stripslashes($value);
}$emailBody = "<HTML>
<BODY>
<TABLE BORDER='1'>
<TR>
<TD align='left' width='780'>Email : ".$Email."</TD>
</TR>
<TR>
<TD align='left' width='780'>Name : ".$Name."</TD>
</TR>
<TR>
<TD align='left' width='780'>Message: <br><br>".$Message."</TD>
</TR>
</TABLE>
</BODY>
</HTML>";if(mail($emailRecipient, "admin Form\n\n", $emailBody, $emailHeaders)){
echo "var1=success";
} else {
echo "var1=failure";
}?>
-
Picture 1.jpg 648.5 K
-
-
28. Re: HELP Contact Page
kglad Jan 11, 2010 1:27 PM (in response to PrintingByDBE)that code works for me. you can test here and send emails to yourself:
-
29. Re: HELP Contact Page
PrintingByDBE Jan 11, 2010 1:34 PM (in response to kglad)hmmm...
when i click the link its a blank white page.. with boxes
but when i enter the info click send it stays like mine!
lol i hope i dont have to like start all over with the design... lol
-
30. Re: HELP Contact Page
kglad Jan 11, 2010 1:39 PM (in response to PrintingByDBE)check your email at admin@the5150crew.com
-
31. Re: HELP Contact Page
PrintingByDBE Jan 11, 2010 2:50 PM (in response to kglad)oh wow!!!
hahahaha im so excited!!!
finaly it worked!!!
im sry i havnt checked the inbox!
THANK YOU SO MUCH KGLAD!!!
-



