email - How to add an attachment to mailto in Java -


i creating text editor , add share feature allow email document. need in finding way use mailto variable. use string "savename" path of file sent. here have right now:

share.addactionlistener(new actionlistener() {         @override         public void actionperformed(actionevent e) {          desktop desktop = desktop.getdesktop();         string maildata = "mailto:?subject=document&attachment=" + savename;         system.out.println(maildata);         try {             desktop.mail(new uri(maildata));         } catch (ioexception e1) {             e1.printstacktrace();         } catch (urisyntaxexception e1) {             e1.printstacktrace();         }          }     }); 

can 1 shed light on how this? appreciated, thanks.

you should use javamail api. allow connect server , send , receive mails.

here example of javamail api attachments.

this page has more comprehensive working examples.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -