Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Send email from Outlook

 
Tirthankar Mukherjee
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way to send an email from MS Outlook from Java? I googled a lot and found something called JACOB, but I am not sure how to use it.

Thanks in advance.
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you actually need your Java application to take control over an Outlook client to send the mail? In that case, JACOB might help you, but it wouldn't be a trivial thing to do.

Much easier would be to use the Java Mail API to make your Java program a mail client to your Exchange server, which is I assume how your Outlook sends out mail. Would that fit your requirement?
 
Tirthankar Mukherjee
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application won't have all the details to configure java mail, but MS Outlook would be configured where the program would execute. I just want to send a email with an attachment (.jpg/.png)
 
Paul Clapham
Sheriff
Pie
Posts: 20763
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer may be yes, sort of. Outlook can be controlled by external programs like that, I used to have a Visual Basic program which did it.

But versions of Outlook since 2003 have had the security feature where when an external program calls Outlook's send-mail feature, it waits until the person sitting at the screen confirms that it's okay to do that.

Frankly it would be easier to use JavaMail. If you can configure Outlook with the address of the mail server, you can certainly configure your application with the same address. I would invest more time in looking at that simple option rather than being dead-set on the horribly complex Outlook-driving option.
 
Tirthankar Mukherjee
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your time, I got your point.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic