-
1. Re: Camel - Mail - Using SMTP to sent emil
davsclaus Nov 26, 2009 3:23 AM (in response to mdav)No you can extend MailConfiguration in your own class and invoke the getInstance method. And then configure your mail configuration on the mail component. Then Camel will use your class instead of its own.
The current code calls:
Session session = Session.getDefaultInstance(prop, getAuthenticator());
But what you want to do is:
Session session = Session.getInstance(prop, getAuthenticator());
I wonder what the difference is between these two methods. Well gotta check the javadoc API for Java Mail
-
2. Re: Camel - Mail - Using SMTP to sent emil
mdav Nov 27, 2009 9:48 AM (in response to davsclaus)Thanks for the reply.I will try with this.
Just wanted to share , what I saw in the doc.
It looks like the default session , which may contain credentials is denied if objects are called from two different classloader.
But if the Authenticator object used to create the session is null, we can get the default session.
Cheers.
-
3. Re: Camel - Mail - Using SMTP to sent emil
davsclaus Nov 27, 2009 11:44 AM (in response to mdav)Let me know how it goes with your extension.
We could probably add that as a fallback into camel-mail. However a unit test to demonstrate the issue is probably not easy to create.