Flex 2 Basic Email Form
Here is a cut and dry example using an HTTP Service to send an email in Adobe Flex 2 via a simple PHP email script. Plain-Simple-Easy… ready for u to customize and expand upon(Validation, Error Handling).
Comments Questions, concerns are welcome.
Enjoy,
-Augie
| example | source code | download |
Posted: January 28th, 2007 under Source Code, Flex 2.0, ActionScript 3.0.
Comments: 19
Comments
Comment from marty
Time: March 3, 2007, 12:29 pm
Hi, Augie:
Great post - very helpful. Can you please tell me what I would modify in the php code and in the mxml file to have the email sent to a specific email address, like “someone@nowhere.com?” I know, it should be easy to figure out but I’m failing at it.
Marty
Comment from marty
Time: March 4, 2007, 1:56 am
THANK YOU FOR THIS TUTORIAL! I figured out how to modify it and now I have a working email form. WAITED SO LONG!
Thanks so much!
Comment from Augie Marcello III
Time: March 5, 2007, 2:56 pm
Hey Marty,
Glad I could help. Keep me posted if you would like to see anything else.
-Augie
Comment from marty
Time: March 14, 2007, 8:34 am
Hey, Augie:
I really liked the way you used the Augie CSS in the tutorial. Anything CSS and states related would be really cool. Seems easy for you - it’s difficult for me.
Marty.
Comment from Somethingornot
Time: April 7, 2007, 1:30 pm
Can you please tell me what I would modify in the php code and in the mxml file to have the email sent to a specific email address, like “someone@nowhere.com?”, and also how would I change the subject line?
Thanks Barry
Comment from Augie Marcello III
Time: April 7, 2007, 1:40 pm
Hi Barry,
There are two ways to edit this:
email.php
——————————————–
Send to Email:
you can set $recipient var to your desired email address:
$recipient = “barry@barry.com;
Subject:
change $subject line to whatever you would like.
$subject = “Barry’s subject line”;
simpleEmailForm.mxml
——————————————-
Send to Email:
You can set that sendToName var to any email address you would like.
var sendToName:String = ‘barry@barry.com’
Subject:
You would have to pass this to the php script and set.
Hope that helps let me know if you have any more questions.
Thanks,
-Augie
Comment from andychin
Time: June 15, 2007, 3:38 am
Hi Aug,
i have a problem here. I always get this error msg saying “parse error at ”
I can not figure it out.
Comment from Augie Marcello III
Time: June 15, 2007, 8:42 am
Hi Andy,
Can you please give me a little more info on the error. Like when you are getting the error, and the steps you are taking to implement the example, and what parts of the php file you are changing etc…
Talk to you soon,
Thanks,
-Augie
Comment from andychin
Time: June 19, 2007, 1:54 am
Augie,
I could just email you the entire MXML n the PHP to have a look. Because I just pickup thiss Flex thinggy. I really have no idea at all.
Can you write me an email to andychin[at]dpa.com.my so I may reply you and attach the file for you to have a look.
I really appreciate it so much.
Comment from andychin
Time: June 19, 2007, 11:35 am
whenever I include this line:
and then once i press CTRL+S to save, an error message shows me saying,
parse error at
Comment from hotice
Time: August 6, 2007, 3:24 am
I Had this code working on a site but it suddenly don’t work anymore. I didn’t change anything in the code. Why is this?
Comment from surag
Time: August 8, 2007, 10:08 pm
Hi Augie,
Thank you very much for the script. I have modified the script as an enquiry form. i have even validated the controls using mx:validator tag. But i failed to pass it to the submit button so that i can submit the form without completing it. pls help me to proper validating the form. i ll be honoured
Surag
Comment from bousquetcm
Time: August 13, 2007, 8:33 am
I tested out the sample you liked above and got the following error. I have been all over the net trying to find a working setup for a flex submit form and am finding nothing so far.
[RPC Fault faultString=”Security error accessing url” faultCode=”Channel.Security.Error” faultDetail=”Destination: DefaultHTTP”]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at ::DirectHTTPMessageResponder/securityErrorHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
Comment from borna
Time: August 14, 2007, 1:05 am
hi.
so great…. so usefull….
I am your new member, and your post is my favorite title in flex…. I get it, but I have a request, yet…
can you do this with a .net form and show us the way?
you know? I’m so weak on PHP?!?!
Sorry, and thanks again…
Comment from augiemarcello
Time: August 18, 2007, 6:49 pm
Hello guys,
I have six new posts with questions that I have not had time to reply to yet because I have been on a much needed vacation. I will look these over in the net 2 days and get back to you with responses.
Thanks,
-Augie
Pingback from List of 31 Flex APIs, Libraries, Components and Tools by Sean // the flash guy
Time: August 21, 2007, 10:07 pm
[…] Flex 2 Basic Email Form Cut and dry example using an HTTP Service to send an email in Adobe Flex 2 via a simple PHP email script. http://augiemarcello.com/flex-2-basic-email-form/ […]
Comment from vitor
Time: August 23, 2007, 3:22 pm
Hi,
Thanks for your post.
I only got one question: I have difficult in understanding this line of as code :
this.emailService.send({senderName: senderName, senderEmail:senderEmail, sendToName: sendToName, sendToEmail: sendToEmail, emailMessage: emailMessage});
I don’t know when it is the component id or when it is the String variable… can you please give me more informations ?
Thanks.
Vitor
Comment from bijlfab
Time: October 29, 2007, 10:27 am
My hero, thank you very much for this
Pingback from RICH INTERNET » Blog Archive » Flex Explorer
Time: May 13, 2008, 7:57 am
[…] Flex 2 Basic Email Form Cut and dry example using an HTTP Service to send an email in Adobe Flex 2 via a simple PHP email script. http://augiemarcello.com/flex-2-basic-email-form/ […]

Write a comment