A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: AS3 Email with subject and body

  1. #1
    Member
    Join Date
    May 2008
    Posts
    59

    AS3 Email with subject and body [SOLVED]

    shareBtn.addEventListener(MouseEvent.CLICK, onShare);
    function onShare(event: MouseEvent) {
    var request:URLRequest = new URLRequest("mailto:emaila address"+"?subject=Subject of email"+"?body=Body of email);
    navigateToURL(request, "_self");
    }

    I'm trying to populate all the fields of an email, but I can only send info to two of them. If I send all three pieces of info the Subject ends up "Subject of email?body=Body of email", but if I ditch either the subject or body the other fields populate correctly. Any ideas why all three can't be populated?

    Cheers
    Last edited by darngooddesign; 01-13-2009 at 05:32 PM.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    The "?" is only used to start the parameter portion of a URL. Parameters are delimited with &.

    Code:
    var request:URLRequest = new URLRequest("mailto:emaila address"+"?subject=Subject of email"+"&body=Body of email);
    You may also need to URLEncode those to turn spaces into %20, etc.

  3. #3
    Member
    Join Date
    May 2008
    Posts
    59
    Thank you sir, that did it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center