to open outlook mail from java program and to attach file to the mail from directory

前端 未结 5 1808

I need to implement Email functionality in my Java application which will open microsoft outlook and attach a file from my directory. Has any implemented the same?

5条回答
  •  爱一瞬间的悲伤
    2020-12-06 15:09

    Here is the exact command you want:-

    new ProcessBuilder("C:\\Program Files\\Microsoft Office\\Office14\\OUTLOOK.exe","/a","C:\\Desktop\\stackoverflow.txt").start();
    

    First Argument-Path to Outlook.

    Second Argument- Outlook attachment command.

    Third Argument- Attachment path

提交回复
热议问题