Solved

Sending an email from Flex application

Posted on 2009-04-08
6
3,500 Views
Last Modified: 2013-11-11
Hi,

I'm building a small flex application, which I'd basically like to be a form where a user can enter their name, email address, and also check a few boxes, then those details be submitted on the click of a button to an email address.  

Most of the methods involved in doing this seem to use php, but I'm sure our iis server can't handle server-side requests (it's old and rubbish), so my question is - is there a way to send to submit emails as per my first paragraph without php etc?  There's an added complication of me wanting to possibly include an attachment too, but if the former is possible but the later not, that would be ok.

Thanks,
John
0
Comment
Question by:RSA_KM_TEAM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 12

Expert Comment

by:lexxwern
ID: 24095751
Do you have access to an SMTP server?
0
 
LVL 12

Assisted Solution

by:lexxwern
lexxwern earned 150 total points
ID: 24095770
Further info, if you have access to SMTP Server then you can use SMTP Mailer for Actionscript: http://www.bytearray.org/?p=27
0
 
LVL 12

Assisted Solution

by:lexxwern
lexxwern earned 150 total points
ID: 24095779
You might also be interested in this: http://code.google.com/p/as3maillib/
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:RSA_KM_TEAM
ID: 24096537
Hi lexxwern,

Thanks for coming back so quickly.  

No, it appears I don't have access to an SMTP Server.

Does this effectively preclude me from what I'm trying to achieve?


0
 
LVL 12

Assisted Solution

by:lexxwern
lexxwern earned 150 total points
ID: 24097048
Probably, you either need server side programming capability (PHP, JSP or ASP) or access to a mail server. :)
0
 

Accepted Solution

by:
TonyCannons earned 100 total points
ID: 24109468
You can do it with asp and cdonts.

Create an asp page to catch the variables posted from your flex app.

cdonts examples:
http://www.powerasp.com/content/hintstips/asp-email.asp
use cStr(Request.Form("senderName")) to catch the variables on the asp side

Flex Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300"  >
	<mx:Script>
    <![CDATA[
    import mx.controls.Alert;
        import mx.rpc.events.ResultEvent;
         import mx.events.CloseEvent;
         
            
 
     
        
        public function sendEmail( ):void
        {
        	submitBtn.enabled = false;
            var senderName:String = senderName.text;
            var senderEmail:String = senderEmail.text;
            var senderPhone:String = senderPhone.text;
            //var sendToName:String = sendToName.text;
            var sendToEmail:String = "email@email.com";
            var senderMessage:String = senderMessage.text;
        
            this.emailService.send({senderName: senderName, senderEmail:senderEmail,  senderPhone: senderPhone, senderMessage: senderMessage});
        
 
        }    
        
        public function emailResult():void
        {
            Alert.show("Email Has Been Sent","Success");
            this.submitBtn.enabled = false;
          
        }
        
    ]]>
</mx:Script>
<mx:HTTPService id="emailService" url="http://www.site.com/email.asp" method="POST" resultFormat="xml" result="emailResult();" useProxy="false"/>
<mx:Form id="emailForm" width="100%" >
         
             <mx:FormItem label="Name:" horizontalAlign="left" width="100%">
                <mx:TextInput id="senderName"  width="100%"/>
            </mx:FormItem>
            
            <mx:FormItem label="E-mail:" width="100%">
                <mx:TextInput id="senderEmail" width="100%"/>
            </mx:FormItem>
         
            <mx:FormItem label="Phone:" horizontalAlign="left" width="100%">
                <mx:TextInput id="senderPhone"  width="100%"/>
            </mx:FormItem>
 
            
            <mx:FormItem label="Message" horizontalAlign="left" width="100%">
                <mx:TextArea id="senderMessage"  width="100%" height="100"/>
            </mx:FormItem>
            
             <mx:FormItem width="100%">
                <mx:Spacer width="200" />
                <mx:Button id="submitBtn" label="Submit" click="this.sendEmail();" />
             </mx:FormItem>
        </mx:Form>
 
</mx:Application>

Open in new window

0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Flash doesn't load in Iphone and Ipad 22 503
Microsoft WSUS 4 116
Missing Plugin for Firefox - Can't View Content 7 188
Running Mp4 or Flash Video 1 149
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question