3

I want to set up an email from Flex so that when I press a button it opens a new message from the default mail program. (In most cases this will be Outlook). I have got something that uses mailTo: and open an new message with the to email address filled in. What I want is to populate the message part of the email. I am not overly concerned with who is in the to: line. I just want the message part populated.

Is this possible in Flex?

Thanks

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
RNJ
  • 15,272
  • 18
  • 86
  • 131
  • http://www.brucephillips.name/blog/index.cfm/2006/11/21/Creating-Web-Page-and-Email-Links-In-A-Flex-Application – Robert Harvey Aug 21 '12 at 15:19
  • http://livedocs.adobe.com/flex/3/html/help.html?content=url_requests_4.html – Robert Harvey Aug 21 '12 at 15:19
  • Hi Robert, thanks for the links. They only tell me how to create a new email with the to field populated with an email address. I am specifically looking at trying to get data into the body of the message. – RNJ Aug 21 '12 at 15:29

1 Answers1

7

Here is a sample to populate the email body

 var mailMsg:URLRequest = new URLRequest('mailto:' + recipients);
 var variables:URLVariables = new URLVariables();               
 variables.subject = mailSubject;
 variables.body = mailBody;
 mailMsg.data = variables;
 mailMsg.method = URLRequestMethod.GET;
 navigateToURL(mailMsg, "_self");
StephenNYC
  • 1,234
  • 3
  • 12
  • 29
  • Perfect! Thanks for the answer StephenNYC – RNJ Aug 22 '12 at 13:29
  • I did the same but my message is not properly formatted . I wanted Name xxxxxxxxxxx Last xxxxxxxxxxx But i am getting like this: Name xxxxxxxxxxx Last xxxxxxxxxxxx Though it has same number of characters on left. Perfect way is to Table format or use monospace font. But how to do so???? – WPFKK Jan 14 '16 at 04:50