Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 911
Juan Techera Avatar asked Jun 11 '10 01:06

Juan Techera


People also ask

What is mailto protocol?

mailto is a Uniform Resource Identifier (URI) scheme for email addresses. It is used to produce hyperlinks on websites that allow users to send an email to a specific address directly from an HTML document, without having to copy it and entering it into an email client.


2 Answers

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.

like image 163
N. Lucas Avatar answered Nov 01 '22 06:11

N. Lucas


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.

like image 31
unomi Avatar answered Nov 01 '22 08:11

unomi