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