-
PHP Emailer not working?
I use Flash CS3 but actionscript 2.0
Hello everybody, I want to make a emailer where u can email me from a flash movie. or I may make a emailer which you tell your friends about a game to unlock stuff.
anyway I click the on the PHP file and run it once its uploaded... yes it works.
i use this:
PHP Code:
<?php
$to = "[email protected]";
$subject = "Hello";
$message = "Hope this will work with flash!";
$from = "Julian Mchutchison <[email protected]>";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Hi everybody";
?>
Yep, as I said it works. where the to and from stuff is, is where flash comes in.
in flash I use this script:
Code:
php = new LoadVars();
pressy.button.onPress = function(){
pressy.gotoAndStop("sending");
php.sendAndLoad("trythi.php",php,"POST");
name = "";
emailfrom = "";
emailto = "";
othername = "";
mes = "";
}
php = new LoadVars();
pressy.button.onPress = function(){
pressy.gotoAndStop("sending");
php.sendAndLoad("trythi.php",php,"POST");
name = "";
emailfrom = "";
emailto = "";
othername = "";
mes = "";
}
then the PHP script i use for that is...
PHP Code:
<?php
$to = $_REQUEST[emailto];
$subject = $_REQUEST[othername];
$message = $_REQUEST[mes];
mail($to,$subject,$message);
echo "You win!";
?>
hmm.... it doesn't work.
It may possibly be because of an INI file i have called php.ini
it contains:
Code:
SMTP = localhost
smtp_port = 25
and it seems to make stuff work.
do i need to load the ini file too to get flash to send something?
or do I just need to use GET instead of POST?
i am still mucking around right now but If i don't sort it out hopefully somebody else will.
thank you, this will help me alot because I have heaps of Ideas to do with this subject, and it will get me more familiar to PHP.
-
Hooray I got it to work!
It was a really simple error, did you gey it? ;)
in case you didn't i forgot to actually send the variables.
but unfortunately instead of the email coming from my email it came from a random email on my server.
that makes complete sense but I want the email to come from the email you put in...???
-
Sorry I even made this thread, I have solved the answer! I made yet another silly mistake and forgot to make all the 'from' stuff so it sent from the default email instead!