pnutbuttrjarz Posted February 17, 2007 Share Posted February 17, 2007 Hey guys...... I have an already completed flash website for my business (a 1.65mb swf file inserted into a table on a html page). On the swf file is a contact form page that looks like this: Basically all I want this to be able to do is the customer/client fill out the fields of the contact form and hit send and it sends whatever was written to my email address. I previously figured out that I needed some sort of php script to enable whatever was typed in the fields to be emailed to my address. I have already asked this question at one of my other forums I hang out at (not a website or php designed forum), and only got 1 response. This is what was posted: First of all you need to make sure you have php webhosting and smtp or pop3 mail server which allow you send mail by php. Once you have follow this: -------------------------- In flash: var mailSendLV:LoadVars = new LoadVars(); var mailReceiveLV:LoadVars = new LoadVars(); mailSendLV.name ="yyy"; mailSendLV.e-mail = "yyy@yyy.com"; mailSendLV.message= "Hello yyy"; //sent this value to php // suppose you have a sendmail.php mailReceiveLV.sendAndLoad("http://www.plasturgieducation.org/formations/platurgie_map/sendmail.php",mailReceiveLV,"POST"); // mailReceiveLV use to make sure your mail has been send mailReceiveLV.onLoad = function (success:Boolean){ if (success){ if(mailReceiveLV.isSent ) trace("your mail has been sent"); else trace("send false"); } } //In PHP code sendmail.php <?php $name = htmlentities($_POST['name']); $to = htmlentities($_POST['e-mail']); $message = htmlentities($_POST['message']); $subject = 'yyy'; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: YYY"; if (mail($to, $subject, $message, $headers)) { // tell flash that your mail already send echo '&isSend=true&' }else{ // or it's fail to sent echo '&isSend=false&' } ?> ---------------------------------- if you are familiar with basic actionscript and php, you would find it uesful. This is how actionscipt and php communicate each other. If this script is correct, where is all of this supposed to go?? Now i've tried to read thru the tutorials here (phpmailer etc) but have only become more confused. Now my site will be hosted on a friends webserver, which I am 98% sure is php enabled. Is this something that can be done all thru dreamweaver?? I can get my way around Dreamweaver and flash professional 8 easily enough, but have no idea how to add any of this php scripting. Everything I read just makes me more and more confused. Is this something that is quite simple, or is this a very complex thing?!?!? Any help will be truly appreciated guys. Regards, Pnut Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted February 17, 2007 Share Posted February 17, 2007 I'm no flash expert...by any stretch of the imagination...but it looks like this: mailSendLV.e-mail = "yyy@yyy.com"; would be where the mail gets sent to. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.