Closed natros closed 9 years ago
I can confirm this issue on Ubuntu 14.04 x86_64 with Java 7. It seems that Desktop.open()
is a bit buggy (take a look at few links: 1, 2).
I've fixed the issue simply by executing command to fire up Thunderbird by Runtime.getRuntime().exec(...)
. I've added command line parameter which can be used to define executable for opening *.eml files as below:
java -jar fakeSMTP-VERSION.jar -e thunderbird
java -jar fakeSMTP-VERSION.jar --eml-viewer thunderbird
Tested also on OSX, proper invocation for Thunderbird:
java -jar fakeSMTP-VERSION.jar --eml-viewer "open -a Thunderbird"
And for Mail.app:
java -jar fakeSMTP-VERSION.jar --eml-viewer "open -a Mail"
So it was tested on Linux with Thunderbird and on OSX with Thunderbird and Mail. I can't test on Windows right now but it should work fine :)
I've submitted PR: https://github.com/Nilhcem/FakeSMTP/pull/22 You can merge it if you think it's okay and may be useful :)
Thanks for both the issue and the PR. #22 is merged.
I'm using ubuntu 14.04 x86_64 with java 7 and FakeSMTP cannot open emails when I double clicked them.
From your code I can see that you are using Desktop.open() to open the emails. I did a test that fails in my case
Testing with a text file (.txt) works, but fails for .eml
Under OSX works fine.
The user should be able to choose another application to open the email.
Thanks java version "1.7.0_72" Java(TM) SE Runtime Environment (build 1.7.0_72-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)