Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

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?

like image 897
Gaurav Anand Avatar asked Nov 27 '22 22:11

Gaurav Anand


2 Answers

According to these docs the command you need is

"path/to/Outlook.exe /c ipm.note /a \"path/to/attachment\""

Assemble this and run it via ProcessBuilder

(Or listen to MarcoS who gives a very good example of why it's sometimes better not to literally answer questions :-))

like image 178
Sean Patrick Floyd Avatar answered Dec 15 '22 04:12

Sean Patrick Floyd


If you want to implement email functionalities in Java, consider JavaMail. Also, if your application has email functionalities, then you don't need to open another email client (such as outlook).

like image 40
MarcoS Avatar answered Dec 15 '22 02:12

MarcoS