Flex 中打开outlook 发送邮件

在Flex中,有时候需要打开outlook来发送邮件,方法如下:

 

private function getUrl():String {

    var url:String = "mailto:" + emailAddress; //收件人地址

    url += "?subject=" + emailSubject;  //邮件主题

    url += "&body=" + emailBody;  //邮件内容

  return url;

}

 

private function openOutlook(event:MouseEvent):void {

    var sendLink:String = getUrl();

    navigateToURL(new URLRequest(sendLink),"_self");

}

 

 <s:Group top="0" left="5" right="0" bottom="5">
     <s:Button label="Send" click="openOutlook(event)" buttonMode="true" height="7%"/>
</s:Group>

你可能感兴趣的:(Flex)