Skip to main content
August 21, 2009
Question

mailto: with Attachement from Flex

  • August 21, 2009
  • 5 replies
  • 15133 views

Hi There,

I'm trying to launch the user's e-mail and automatically embed an attachement:

What I'm trying is:

         var src:String = "mailto:test@test.com&subject=test_subject&body=testBody&attachment=assets/test.gif";
           var urlReq:URLRequest = new URLRequest(src);
          navigateToURL(urlReq, "_self");

assets/test.gif is a subfolder to the html hosting the swf

The e-mail launches - but there is no attachment.  Is there something I can do to access the file?  I have also tried surrounding the attachment filename in double quotes - e.g. attachment=\"assets/test.gif\"

Thanks,

Tim

    This topic has been closed for replies.

    5 replies

    Participant
    March 7, 2013

    Even i tried a lot. but no lead. i dont want to use server thing for attachments. Anyone ther please help

    Adobe Employee
    March 7, 2013

    Does the mailto: spec support attachments?

    Participant
    April 25, 2013

    NO mailto does not support attachments.

    DonMitchinson. Thanks for the hint on coltware. Do you know if using this library we can create a mail using client default mail as outlook ?

    Thanks,

    Rafael

    January 27, 2012

    Wow, a reply over 2 1/2 years after my original question.  Thanks very much for the time - to be honest, I can't even remember the app exactly that I was trying to do this in!

    I'll mark it as a helpful answer :-)

    Inspiring
    January 27, 2012

    Didn't realize it was that old!

    Just saw in the right hand column of related questions when I was replying to a similar one.

    Don

    Inspiring
    January 26, 2012

    I believe it's possible but not the way you're trying - only if you want to use smtp.

    That brings up other issues - but I believe it's the only way.

    I think some people have tried this and even set up libraries

    and sample Actionscript code to demo its use.

    Coltware - has some example code (AirXmail) - I've never tried but it looks doable.

    http://flex.coltware.com/tag/smtp/

    That is his blog with useful examples.

    Actual downlable code is on Google code

    http://code.google.com/p/airxmail/downloads/list

    And I found another great SMTP example library that handles attachments now with examples at

    http://www.bytearray.org/?p=27

    Message was edited by: DonMitchinson Added additional SMTP urls

    August 21, 2009

    Flex simply does not allow for what you are trying to do. You need to upload files to the server and send the email via PHP, etc.

    If this post answers your question or helps, please mark it as such.

    subedimadhav
    Inspiring
    August 21, 2009

    your link launched the new email wizzard of email client installed in your computer, but your file is located in the webserver root.

    this is not solution, but for the test you could do "C:\test.gif".

    if you want to send automated emails, you could use the server script.