SMTP Authentication not working with SessionBean
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ananda_tanguturi
Posted On:   Thursday, August 2, 2001 05:07 AM

I have a problem with SMTP authentication - while using the JAVAMail in Session Bean. The same code works fine when i run it as a java application. I used (mail.smtp.auth,"ture") for the properties and trans.connect(host,user,password). This works fine in a standalone applications.. but does not work when i use it in a session bean. I am using WLS6.0, created a mail session from the console and did the JNDI look up in the bean class the part of the code is as follows: Context ctx = new InitialContext(); Object a = ctx.lookup("pms"); javax.mail.Session b = (javax.mail.Session) a    More>>

I have a problem with SMTP authentication - while using the JAVAMail in Session Bean.


The same code works fine when i run it as a java application.


I used (mail.smtp.auth,"ture") for the properties and trans.connect(host,user,password).


This works fine in a standalone applications.. but does not work when i use it in a session bean.


I am using WLS6.0, created a mail session from the console and did the JNDI look up in the bean class the part of the code is as follows:



Context ctx = new InitialContext();
Object a = ctx.lookup("pms");


javax.mail.Session b = (javax.mail.Session) a


mailProps.put("mail.smtp.host", host);
mailProps.put("mail.smtp.auth", "true");


Session mailSes = iniSes.getInstance(mailProps, new SMTPAuth());
mailSes.setDebug(true);


Transport mailTrans = mailSes.getTransport("smtp");


mailTrans.connect(host,user,password);


mailTrans.send(message)


this is giving me authentication failure exception 550.
It works fine with a standalone application.
Can any one explain please.

   <<Less

Re: SMTP Authentication not working with SessionBean

Posted By:   jo_zdf  
Posted On:   Monday, September 10, 2001 07:49 AM

Hi Ananda,

i have the same problem. Did you find aleady a solution?
I am using iplanet AppServer SP3.

Re: SMTP Authentication not working with SessionBean

Posted By:   ananda_tanguturi  
Posted On:   Thursday, August 2, 2001 05:10 AM

please read it as:
javax.mail.Session iniSes = (java.mail.Session) a
in the above code
About | Sitemap | Contact