aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes JavaMail or Desktop API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "JavaMail or Desktop API" Watch "JavaMail or Desktop API" New topic
Author

JavaMail or Desktop API

Joe Mastro
Greenhorn

Joined: Jan 05, 2012
Posts: 14
I am currently using the Desktop API to send email to users on a network through a Java Swing application. I click a JButton, it invokes the default email client application (which is GroupWise) with prefilled data in the subject, body,to fields, etc. and then click send. This works great except for the fact that I don't want the Groupwise dialog box to appear showing all the prefilled fields. I want to send the email without being promted with the email client dialog box and having to click send. From my research I really don't think this can be done using the Desktop API. So....

1. If this can be done with the Desktop API please point me in a direction as to how this can be done.

2. If not, should I be using the JavaMail API or a different API to send the email to users on the network? I do not want to get email server admin staff involved for configurations as it is not a large project.

Basically, I need a simple way to transport messages without the hassel of invoking my email client dialog box everytime a predfined email is sent to users.

Thanks for any help.

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
If you don't need to receive emails -just send them- check out the Aspirin library.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18651
    
    8

Joe Mastro wrote:Basically, I need a simple way to transport messages without the hassel of invoking my email client dialog box everytime a predfined email is sent to users.


And just to clarify something which wasn't clear from your post: Do you care who those e-mail messages appear to come from?

I ask because your Desktop approach causes the e-mail messages to come from the person who clicks OK on the GroupWise dialog box. If you switch to some other solution which doesn't require interaction with the user, then you're going to have to decide on a "From" address, or configure one perhaps. And you might have to deal with authentication -- another thing which is taken care of when the user clicks OK on the GroupWise dialog.
Joe Mastro
Greenhorn

Joined: Jan 05, 2012
Posts: 14
Yes I do. The e-mail messages should come from the person who clicks OK on the GroupWise dialog. The users email address is automitacally populated in the "From" box when the Groupwise client is invoked and that is how I intended it to be. It is a "ticket" application so the email gets sent to a designated staff in IT with a problem description and a ticket number. It was an MS Access vba application that is being converted to a Swing app. and in vba I used DoCmd.SendObject acSendNoObject to accomplish opening GroupWise client, filling in the fields and automatically sending the email without a GroupWise dialiog prompt.

Also to clarify original post, I originally wrote it as my application that is invoking the GroupWise email client but just the same it could be any one of the users invoking the email client also on their machine.. Not that it matters, the principal is the same....everyone has a copy of the app, each app invokes GroupWise email client on their machine and fires off email to appropriate To: destination.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18651
    
    8

Joe Mastro wrote:Yes I do. The e-mail messages should come from the person who clicks OK on the GroupWise dialog. The users email address is automitacally populated in the "From" box when the Groupwise client is invoked and that is how I intended it to be.


That's what I suspected. This dialog box which pops up may be annoying but it has two important features: it automatically inserts the current user's e-mail address in the From address, and it authenticates with the GroupWise server. If you want to modify the system so that it doesn't pop up the dialog box, then you're going to have to replicate those features on your own in the modified system.
Joe Mastro
Greenhorn

Joined: Jan 05, 2012
Posts: 14
I guess I was spoiled with using the methods of the Docmd object in vba where I could use one line of code to invoke the email GroupWise client, prepopulate all the necessary fields in the GroupWise client dialog, and send the email without ever having to see the GroupWise client dialog. I'll also check out the Aspirin suggestion. Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JavaMail or Desktop API