Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-09-01 Thread Dignesh
Hi Mathew , Romain Thank you very much for your help on this. I just debugged the code again. The issue was i was setting the boolean value for "mail.smtp.auth" property. p.put("mail.smtp.auth", true); modified to p.put("mail.smtp.auth", "true"); to resolve the issue. :) Thank you very

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-09-01 Thread Romain Manni-Bucau
If you use tomee.xml or resources.xml yes, if you don't use the built-in factory then you need to handle it yourself Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-09-01 Thread chongma
so looking at line 31: final String password = properties.getProperty("password"); that might mean the password should be passed as: p.put("password", "smtppassword"); and it is not necessary to pass an Authenticator with PasswordAuthentication? -- Sent from:

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-09-01 Thread Romain Manni-Bucau
For reference there can be some config changes after the 1.9 upgrade ( https://issues.apache.org/jira/browse/TOMEE-1697). Would be good to ensure 1. you authenticator is actually called (if the LOGIN fails it can be it read the password from the session properties where it is not. FYI here is how

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-09-01 Thread chongma
actually i just looked at my old code before i changed to loading session in context.xml and this is how i used to create a mail session and authenticate (before i changed to SSL). private Session getSession() { Authenticator authenticator = new Authenticator(); Properties properties = new

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-09-01 Thread chongma
is the server protected by TLS or SSL? or is it open? if SSL protected have you tried: p.put("mail.smtp.auth", "true"); p.put("mail.smtp.ssl.enable", "true"); Also have you tried loading Mail Session as a Resource in context.xml (or tomee.xml) as per my previous example? I didn't have much

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-09-01 Thread Dignesh
Hi Romain, Thank you very much for quick reply. Can you try to set mail.smtp.auth before creating the session? - I added this -still it doesnt work Also maybe debug in your authenticator to check it is well used. - I haven't understood what needs to be done here .can you please elaborate on

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-08-31 Thread Romain Manni-Bucau
Hi Dignesh, Can you try to set mail.smtp.auth before creating the session? Also maybe debug in your authenticator to check it is well used. Le 1 sept. 2017 06:22, "Dignesh" a écrit : Loading javamail.default.providers from

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-08-31 Thread Dignesh
Loading javamail.default.providers from jar:file:/C:/Users/dgoyal/Desktop/geronimo-javamail_1.4_mail-1.7.jar!/META-INF/javamail.default.providers DEBUG: loading new provider protocol=smtp, className=org.apache.geronimo.javamail.transport.smtp.SMTPTransport, vendor=Apache Software Foundation,

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-08-31 Thread Dignesh
Loading javamail.default.providers from jar:file:/C:/Users/dgoyal/Desktop/geronimo-javamail_1.4_mail-1.7.jar!/META-INF/javamail.default.providers DEBUG: loading new provider protocol=smtp, className=org.apache.geronimo.javamail.transport.smtp.SMTPTransport, vendor=Apache Software Foundation,

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-08-29 Thread Romain Manni-Bucau
just add in properties mail.debug=true BTW, why not using tomee.xml to define this resource? We have some code using this decriptor to handle the authentication a default resource wouldn't have. Romain Manni-Bucau @rmannibucau | Blog

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-08-29 Thread Dignesh
Hi Romain, I am using IIS as my mail server. can you please let me know on what package you want debug trace to be enabled. Thank you, Dignesh, -- View this message in context:

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-08-29 Thread Matthew Broadhead
Hi, i have a working setup.  first i put the mail resource in src/main/webapp/META-INF/context.xml like this             mail.smtp.port="465" mail.smtp.auth="true" mail.smtp.user="nore...@domain.tld"         mail.smtp.password="smtppassword" password="smtppassword"        

Re: geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-08-29 Thread Romain Manni-Bucau
Hi what is your mail server? can you activate the debug traces? Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn

geronimo-javamail_1.4_mail-1.9.0-alpha-2: sending email fails

2017-08-29 Thread Dignesh
TomEE 7.0.2 :- Sending email fails. javamail's Transport.send(...) function throws an exception. For me looks like some issue with "geronimo-javamail_1.4_mail-1.9.0-alpha-2.jar" jar. If I add different mail.jar in lib folder the same code works fine Attached the 2 jars and the sample code.