Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes HTML in Desktop.mail(URI)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "HTML in Desktop.mail(URI)?" Watch "HTML in Desktop.mail(URI)?" New topic
Author

HTML in Desktop.mail(URI)?

Brian Batson
Greenhorn

Joined: Jun 15, 2011
Posts: 11
Has anyone ever used the Desktop.mail(URI) method to generate an e-mail and successfully used HTML within the e-mail body?

I know this is possible using the JavaMail API, but I'm running into problems with that given my firm's implementation of heavy security around Microsoft Exchange.

Right now this is my simple code:


However, the body of the e-mail actually shows the HTML tags and does not format the text as intended. I feel like I'm missing something obvious. As a side note, I really wish attachments were possible using the Desktop.mail(URI) method.

Any guidance is appreciated very much.

Thank you,
Brian
Wim Vanni
Ranch Hand

Joined: Apr 06, 2011
Posts: 96

I notice that it is rather incomplete html you're writing there (no <body> tag for example). Not sure if that matters in this particular case.

Cheers,
Wim

Edit: StackOverflow lists an answer that in the mailto body you have to use plaintext.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML in Desktop.mail(URI)?