all groups > flash actionscript > march 2005 >
You're in the

flash actionscript

group:

email from flash with php


email from flash with php (_seb_)
3/26/2005 8:08:18 PM
flash actionscript:
A while ago David Powers sent posted some instructions to send an email
from Flash, using php. Now, I have tried to follow the instructions,
with no success. No email gets sent, and I don't know what I'm missing.
Bellow is the actionScript and the php as I copied them, and that I
followed exactly from David's example.
Of course I put my actual email address in the php script. And I
correctly created my submit button in Flash.

So If you see what's wrong in either the actionScript or the php, please
let me know:

1. Actions for the submit button:

submit_btn.onRelease = function() {
sendMail.name = name_txt.text;
sendMail.email = email_txt.text;
sendMail.comments = comments_txt.text;
sendMail.sendAndLoad("sendmail.php?ck=" + new Date().getTime());
};
var sendMail:LoadVars = new LoadVars();


2. PHP script (called sendmail.php, and save it in the same folder
as your SWF):

<?php
$to = 'me@mydomain.com'; // this is the email you want to send to
$subject = 'Feedback from Flash';
$message = 'Message from: ' . stripslashes($_POST['name']) . "\n";
$message .= 'Email: ' . $_POST['email'] . "\n";
$message .= 'Comments: ' . stripslashes($_POST['comments']);
$from = $_POST['email'];

mail($to,$subject,$message,$from);
?>



--
Re: email from flash with php (_seb_)
3/26/2005 8:29:47 PM
I tested the php and it works.

Something's wrong with the actionscript.

[quoted text, click to view]

--
AddThis Social Bookmark Button