A Flash Developer Resource Site

Results 1 to 4 of 4

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.

  4. #4
    Junior Member
    Join Date
    Jun 2021
    Posts
    6
    Hey! This post is really very useful, but it is important to understand that such a letter can be done much faster if you just use the site https://stripo.email/blog/library-of...as-a-template/
    Here you can find a lot of ready-made templates for your letters and not waste a lot of time creating them yourself.

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