views:

816

answers:

2

I have a Java program which generates a PDF file. I want the user to click a button to open the default email client ready to send the PDF as an attachment. The two standard ways of opening the default email client have problems:

  1. Java 6 doesn't seem to allow for attachments in the generated message
  2. JDIC has a bug which prevents Outlook 2007 from sending the message correctly: http://jdic.dev.java.net/issues/show_bug.cgi?id=160

Can anyone suggest a way to do this?

Thanks

+1  A: 

Did javax.mail.internet.MimeMultipart go away? That's sort of the canonical way to set up an attachment.

Update

Okay, so if I've got this straight, you want to know how to let your application use an unspecified email client on an unspecified operating system to send a multipart MIME email containing an undefined attachment but not by constructing the MIME message yourself?

... well, okay, I guess you mentioned Outlook so it must be Windows. But still.

Charlie Martin
This is a SWT desktop application so the user will likely have an email client on the desktop and will not want to configure my app for sending emails.
Mark
A: 

Is there a specific reason you'd like to use the default e-mail client, rather than sent it from Java using the e-mail client (JavaMail)?

Can you provide more details as to the kind of application you're trying to write? I take it this is a client GUI application (Swing/SWT/AWT), but beyond that, I think we're going to need more details.

Jack Leow