Start Mail-Client with Attachment?

后端 未结 3 1024
一整个雨季
一整个雨季 2020-11-27 07:01

I\'m currently searching for a way (in Java) to start the default mail client with defined receiver, subject and body and with a predefined attachment.

Due to the li

3条回答
  •  孤街浪徒
    2020-11-27 07:37

    Probably it's too late by now, but just in case anybody still finds this problem:

    Desktop.getDesktop().mail(new URI("mailto:email@example.com?subject=attachment_example&body=see_attached_file&attachment=/path/to/attachment"));
    

    should do the trick in a platform-independent way.

提交回复
热议问题