Copy link to clipboard
Copied
I am using the following code to open my client email program and I want the address, subject field and body text completed.
submit_btn.addEventListener(MouseEvent.CLICK, sendMessage);
var subject="My Subject"
var body="This is text. This is text. This is text. This is text. This is text. This is text. "
var to="me@address.net"
function sendMessage(event:MouseEvent):void {
var email:URLRequest = new URLRequest("mailto:"+to+"?subject=" +subject+ "&body="+body);
navigateToURL(email, "_self");
}
The problem is no matter what I have tried I cannot get the subject and body text to show any text. The email client open and the correct address is shown. Is this a problem with trying to run it locally and not from server or is there a problem with the code? I'd really appreciate any help with this. Thanks.
Your code looks fine. It is always best to test email-related functionality on a server, and often html page functionality as well.
Copy link to clipboard
Copied
Your code looks fine. It is always best to test email-related functionality on a server, and often html page functionality as well.
Copy link to clipboard
Copied
Thanks for taking a look. I found the problem. I am doing this for an eLearning program
and that program does not use AS3. I have done it
in AS2 (getURL) and it works fine. 🙂
Copy link to clipboard
Copied
You're welcome. Odd that you didn't realize that since it is a learning program.
Copy link to clipboard
Copied
Yes, just learning all the quirks of the new authoring program. But thanks
for your help.