I have an AIR app that needs to open and pre-populate an email in the user's
default email
application. This is not difficult, see the application code I've provided at
the end of this
post.
When you build this AIR app and run it on a mac, it works fine - any carriage
returns you
typed in the text area are displayed properly in apple mail and other mac email
clients.
When you build this AIR app and run it on a pc, it fails. Only the text before
the first
carriage return is displayed.
I have tried the following:
1. forcing word wrapping in the text area
2. replacing new lines in the text ("\n") with a windows return and new line
("\r\n") using
this regular expression: /\r\n/gm;
Any ideas or suggestions would be greatly appreciated!
Thanks
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" width="800" height="600" backgroundColor="white">
<mx:Script>
<![CDATA[
import flash.net.navigateToURL;
private function onSend():void
{
var address:String = "<address>";
var subject:String = "<subject>";
var body:String = ta.text;
var sendURL:URLRequest = new
URLRequest("mailto:"+address+"?
subject="+subject+"&body="+body);
navigateToURL(sendURL);
}
]]>
</mx:Script>
<mx:VBox width="100%" height="100%">
<mx:TextArea id="ta" width="100%" height="100%"/>
<mx:Button label="Send" verticalCenter="0" horizontalCenter="0"
click="onSend()"/>
</mx:VBox>
</mx:WindowedApplication>