• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to get "Subject" & "Message" text from Flash form to default e-mail MS Outlook?

New Here ,
Apr 28, 2012 Apr 28, 2012

Copy link to clipboard

Copied

Hi,

I have the following code which is working fine except I can't get the user typed data from flash form to my default e-mail (MS Outlook) application. How to edit the following code?

In the code:

1) To  ---->  this field is okay since this email ID doesn't change

2) Cc  ---->  this filed is also okay since no changes will be in email ID

3) Subject  ----> this may not be always as "Feedback", user may like to change the subject

Whant I would like to add more here is:

1) From  ----> this text to be retrieved from "fromText.txt" input text box

2) Message  ----> this text to be retrieved from "MessageText.txt" input text box

//1.Button event listener
SendMail.addEventListener(MouseEvent.CLICK, SendEMail);

//2.The SendMail function open up email application to send email.

function SendEMail(event:MouseEvent):void {
var email:URLRequest = new URLRequest("mailto:administrator@helpdesk.com?CC=poweruser@helpdesk.com&Subject=Feedback");
navigateToURL(email, "_blank");
}

Thanks in advance for any support.

Regards.

TOPICS
ActionScript

Views

986

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 29, 2012 Apr 29, 2012

use:

var email:URLRequest = new URLRequest("mailto:administrator@helpdesk.com?CC=poweruser@helpdesk.com&Subject="+ subjectText.text+"&body=from: "+fromText.text+"\n\n"+MessageText.text);

Votes

Translate

Translate
Community Expert ,
Apr 28, 2012 Apr 28, 2012

Copy link to clipboard

Copied

add a subjectText input textfield and use:

function SendEMail(event:MouseEvent):void {
var email:URLRequest = new URLRequest("mailto:administrator@helpdesk.com?CC=poweruser@helpdesk.com&Subject="+subjectText.txt+"?body=from: "+fromText.txt+"\n\n"+MessageText.txt);
navigateToURL(email, "_blank");
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 28, 2012 Apr 28, 2012

Copy link to clipboard

Copied

Thanks for the reply. I tried the code and result is like the following:

To: administrator@helpdesk.com

Cc: poweruser@helpdesk.com

Subject: [object TextField]?body=From: [object TextField]

Body: Blank

The problem exist in SUBJECT & BODY.

Further help, please.

Thanks.

PS: I removed the ? before body and put & ------> the result is as follows:

To: administrator@helpdesk.com

Cc: poweruser@helpdesk.com

Subject: [object TextField]

Body: From: [object TextField]

           [object TextField]

One more thing that it opens an empty web page with the following text in adress bar:

mailto:administrator@helpdesk.com?CC=poweruser@helpdesk&Subject=Feedback

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2012 Apr 29, 2012

Copy link to clipboard

Copied

LATEST

use:

var email:URLRequest = new URLRequest("mailto:administrator@helpdesk.com?CC=poweruser@helpdesk.com&Subject="+ subjectText.text+"&body=from: "+fromText.text+"\n\n"+MessageText.text);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines