I am trying to send an eMail with attachment, without the use of an 3rd party mailserver (like smtp.gmail.com).
Basics/Preperation
In this thread I followed the advice to construct the MimeMessage first and then send it by myMailQue.queMail(msg);
.
It works fine in a test package. I get the following output on the terminal:
Jul 31, 2015 2:28:00 PM Aspirin run
INFORMATION: QueManager.run(): QueManager started.
Jul 31, 2015 2:28:01 PM Aspirin run
INFORMATION: RemoteDelivery (RemoteDelivery-1).run(): Try to give back RemoteDelivery object into the pool.
and the mail arrives after some seconds.
The Problem
When I try to use it in my OSGi framework (felix) no mail is send. There is no exception or any other information printed, even the output mentioned above!
I was not able to find a bundle version the aspirin-jar, so I converted it myself with bnd. Like this:
java -jar bnd-2.1.0.jar wrap jar/aspirin-0.8.3.jar
My Tests
With the converted jar in my bundle folder, there are no wiring-packages-issues, so it should work? Example for the issues:
Unresolved constraint in bundle edu.hm.ee.hem.validation [5]: Unable to resolve 5.0: missing requirement [5.0] osgi.wiring.package; (osgi.wiring.package=org.masukomi.aspirin.core)
My code from which I call queMail(msg)
is able to call other methods of the aspirin bundle.
For example I am calling the function myMailQue.getQueueSize()
once before queMail(msg)
and once afterwords.
The results are 0 and 1, that makes sence (imo).
I am really confused by this set-up not working, especially without any Exception it's hard to understand what is going wrong
So I think the only difference between my test package and the framework, is the converted jar. Has anyone an idea how I could solve the problem?
Thank you very much in advance
P.S. This my first question here (I've read a lot ;) So if I am missing any important information or the format of my question makes it hard to understand please give me a hint.