Simple contact form application in Flex:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
        <mx:HTTPService id="sendMail"
url="http://www.yoursite.com/mailscript.php"; useProxy="false"
method="POST">
                <mx:request xmlns="">
                        <name>{txtName.text}</name>
                        <email>{txtEmail.text}</email>
                        <message>{txtMsg.text}</message>
                </mx:request>
        </mx:HTTPService>
        <mx:Panel title="Contact Form">
                <mx:Form width="100%">
                        <mx:FormItem label="Name">
                                <mx:TextInput id="txtName" />
                        </mx:FormItem>
                        <mx:FormItem label="Email Address">
                                <mx:TextInput id="txtEmail" />
                        </mx:FormItem>
                        <mx:FormItem label="Message">
                                <mx:TextArea id="txtMsg" />
                        </mx:FormItem>
                </mx:Form>              
                <mx:ControlBar horizontAlign="right">
                        <mx:Button label="Send Email" click="sendMail.send()" />
                </mx:ControlBar>
        </mx:Panel>
</mx:Application>

Simple PHP script, mailscript.php, which will get the POST values and
send the email:

<?php

// no validation code... assume validation is done on Flex's end
$yourEmail = "[EMAIL PROTECTED]";
$mailheaders = "From: <" . stripslashes($_POST['email']) . ">\n";
$mailheaders .= "Reply-To: <" . stripslashes($_POST['email']) . ">\n\n"; 
$subject = "Message from " . $_POST['name'];

mail($yourEmail, $subject, $_POST['message'], $mailheaders); 

?>

Hope that helps... untested, but should get you on the right track.

Brian
--- In [email protected], "jf.saldanha" <[EMAIL PROTECTED]> wrote:
>
> To me, in this days of Flex are important see a example of Flex and 
> PHP on send a Email dont see anything on the Web.
> 
> If someone have or see a example or a tutorial about that.
> 
> Thanks
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to