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

2

6

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.

Perspicuous answered 11/6, 2010 at 1:1 Comment(0)
L
8

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.

Lichenology answered 11/6, 2010 at 1:15 Comment(3)
the app is run locally, so attachment=pathtofile ? nice, have to try that ;)Perspicuous
forums.devshed.com/beginner-programming-16/… talks about using &attachment in mailto:Lichenology
Also on Linux for example this is supported by Evolution, but not by Thunderbird.Zither
C
2

mailto allows you to define the body of the email, so it is conceivable that you could embed a base64 encoded image. The problem is how to get the screenshot passed to it.

Cub answered 11/6, 2010 at 1:10 Comment(1)
But be aware of the ~2000 char length limitationInelegancy

© 2022 - 2024 — McMap. All rights reserved.