views:

501

answers:

4

i wanted to know that using actionscript, is it possible to send email and create a front end in flashbuilder 4(flex), everywhere i see php being used for mails, is it possible?

A: 

You can't, flash is a client language.

metrobalderas
Actually, you can.
kkyy
This is actually a reason why you can. You create an SMTP client to send an email.
Hrundik
+7  A: 

best practice would be to create a server side service to handle sending the email and having the Flex frontend communicate with that service.

There is however a library for as3 called as3maillib that you might want to checkout. I personally would recommend keeping it server side.

Chris Gutierrez
Just to add to this, if you're looking to use AIR everything is fine, but for web hosted flex application, you won't be able to connect to servers other than the one your file is hosted on (including mail servers) if they do not specifically let you. Google "adobe crossdomain" for more info.
Robert Bak
+3  A: 

Although the common practice is to send email using server side scripts, it is possible also in plain as3 using socket connections. There are even some libraries for this, like as3maillib and SMTP Mailer.

Edit: The SMTP Mailer page seems to be down at the time of writing, but you can see it through google cache...

kkyy
A: 

Ideally if you are writing an AIR application, you go for some of the libraries mentioned in above answers and send mails directly form flex. For security reasons it is always a better idea to send mails form the server side component for web based flex applications. SMTP is not secure and there are many security holes for hackers if you directly send the content over to mail server from clients browser using Flex or any other method, more over flex might not allow you to do some of the cross server interactions (be prepared to face them)

scienty