Java - Send Email using Default Email Provider
<p>I have written a Java Code so that if a button is pressed the default email provider would open up automatically to be able to send an email. is there a possibility that i can attach a file to the email automatically and set a subject for the emails?</p>

<p>this is the code so far:</p>

<pre><code>        if(role.getValue().equals("1")) {
                try {
                    Desktop.getDesktop().browse(new URI("mailto:username@domain.com?subject=New_Profile&amp;body=see attachment&amp;attachment="PVS_XML.xml""));

                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (URISyntaxException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }       
        }
</code></pre>

<p>the code above is for some reason not working: its underlining the whole of mailto method saying : Syntax error, insert ";" to complete BlockStatements. </p>

<p>Any ideas why ?</p>
