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.
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);
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");
}
Copy link to clipboard
Copied
Thanks for the reply. I tried the code and result is like the following:
To: administrator@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
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
Copy link to clipboard
Copied
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);