Search code examples
flashactionscript-3mailtoemail-attachments

Is it possible to add a attachment to a mail with the mailto function in actionscript 3?


Is it possible to add a attachment to a mail with the mailto function in actionscript 3? Thats the thing, i want to open the default mail program compose window with some data but i also need to add a file as attachment, and that file must be a screen capture of the app. Im doing some research and cant find nothing even close to this, someone have any ideas? All help will be appreciated because im really lost here. Thanks in advance ;)

Edit:

    public function onClickEmail(event:MouseEvent):void{
        var url:String = "mailto:[email protected]?subject=Configurador&body=testing&attachment=C:\Users\Juan\Documents\AvoiderGame\test.bmp";
        var request:URLRequest = new URLRequest(url);
        try {
            navigateToURL(request, '_self');
        } catch (e:Error) {
            trace("Error occurred!");
        }
    }

That didnt worked :( it opens the mail client all info is ok but no file attached

2nd Edit:

Looks like the attachment=path/to/file dont work anymore in new email clients, i think it worked until outlook 97 then it was removed for security reasons and so now is imposible to do this anymore. Thanks for all the answers, Im selecting the N. Lucas answer because his answer was right, is just that it is no longer possible.


Solution

  • From my understanding, using &attachment=file only works locally.

    mailto:[email protected]?subject=file&body=see+file&attachment=\\host\path\to\file
    

    Where as

    mailto:[email protected]?subject=file&body=see+file&attachment=http://domain/file
    

    does not work.