|
||||||||||||||||||||||
Welcome To NewFreeTemplates.com Flash Tutorials Area - Send a form from Flash
Use PHP code to send email directly from Flash
Create the form:
Create PHP file and name it mail.php. This file will send the form using your web server. Paste the PHP code into your mail.php file. Replace youremail@yourdomain.com with your email address. You can customize the mail.php file to have your look and feel.
<HTML> <BODY> <!-- START EMAIL CODE --> <? // the following code will send the email // consult your web hosting provider in case of any problems // you can copy & paste the code into your HTML page // copy all code between <!-- START EMAIL CODE --> and <!-- END EMAIL CODE --> // the form will work if published online // it will not work from your local disk // put your email address here // the form will be sent to this email $to = "youremail@yourdomain.com"; // use echo to display information after the user has submitted the form echo"Thank you for your message"; //list all fields echo"<br>Name: $_GET[f_name]\n"; echo"<br>Phone: $_GET[f_phone]\n"; echo"<br>Email: $_GET[f_email]\n"; echo"<br>Message: $_GET[f_text]\n"; echo"<br>\n"; //send the email: $mailtxt is the content of the email $mailtxt ="This text will appear at the top of the email"; // use "\n" to add line breaks $mailtxt .="\n"; $mailtxt .=" Name: $_GET[f_name]\n"; $mailtxt .=" Phone: $_GET[f_phone]\n"; $mailtxt .=" Email: $_GET[f_email]\n"; $mailtxt .=" Message: \n$_GET[f_text]\n"; $mailtxt .="\nThis text will appear at the bottom of the email\n"; $subject = "Put your subject here"; $headers="From: Your name <" + $to + ">\r\n"; mail($to, $subject, $mailtxt, $headers); ?> <!-- END EMAIL CODE --> </BODY> </HTML> Upload all files on your web server: 1 Flash file (SWF), 2 Your web page, 3 mail.php file. Test the form if it works. Consult your web hosting provider if sendmail if allowed for your account.
Author: www.flashdesignerzone.com
|
|
|||||||||||||||||||||
|
||||||||||||||||||||||
| All Rights Reserved 2007-2008 by NewFreeTemplates.com | ||||||||||||||||||||||