File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Send email from Outlook Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Send email from Outlook" Watch "Send email from Outlook" New topic
Author

Send email from Outlook

Tirthankar Mukherjee
Ranch Hand

Joined: Apr 08, 2006
Posts: 51
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

Joined: Oct 01, 2001
Posts: 2771
    
  10

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

Joined: Apr 08, 2006
Posts: 51
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
Bartender

Joined: Oct 14, 2005
Posts: 18121
    
    8

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

Joined: Apr 08, 2006
Posts: 51
Thanks for your time, I got your point.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Send email from Outlook
 
Similar Threads
Appending HTML formatted text in an Email
fetching an Email through java mail
Send email in jsf
Saving mail from outlook with attachment with Java
Problem in formatting of what is displayed in Outlook's opened window