-
1. Re: Dynamic Mail Configuration for gmail - issue
lvdberg Apr 20, 2011 12:21 PM (in response to kmranganathan)Hi,
It is not clear to me why you want to change mail handling for each related person. Do you mean that you have to connect to each of their servers directly, or do you mean that you just need to send an email.
If it is the first, I would look for direct interaction with the JavaMail Api, within a Seam bean.
If it is the second, it's just changing the recipient name in the template.
Leo
-
2. Re: Dynamic Mail Configuration for gmail - issue
kmranganathan Apr 22, 2011 12:11 PM (in response to kmranganathan)Hi,
Basically each user has his/her own gmail id. When a user logs in and wants to send email, it needs to be sent from his/her id. So, I need to connect to the gmail SMTP server with that user's email id and password for this to happen. So, I end up configuring every time.Ok, so looks like I will have to write Java mail myself - which is easy, but rendering wouldn't be as easy as in seam.
-
3. Re: Dynamic Mail Configuration for gmail - issue
cosmo Apr 22, 2011 7:03 PM (in response to kmranganathan)Regarding to your first attempt, did you tried injecting(@In or Component.getInstance()) your EmailConfiguration component instead of construct it yourself?
-
4. Re: Dynamic Mail Configuration for gmail - issue
kmranganathan Apr 26, 2011 10:51 AM (in response to kmranganathan)I tried Component.getInstance(), but got a ClassCastException - I then checked seam MailSession.java code, I see that Unwrap method has been used to return a java.mail.Session instance. hmm...this is interesting
So, propably this was the reason I got the error initially. This also means that I haven't coded my custom configuration correctly. Have to figure that out.