on 02-17-2005 7:28 AM
Hi all,
I am using WAS SP9 (with EP & KM). I am connecting to corporate exchange server and i am sending mails and i have permission to relay from my server also. The code i used is working fine in webdynpro and also in simple java file but its not working in Abstract Portal Component. Following is the code snippet....
boolean sessionDebug = false;
Properties props = System.getProperties();
props.put("mail.smtp.auth","true");
props.put("mail.transport.protocol", "smtp");
Session session = Session.getDefaultInstance(props, null);//getting error in this line
session.setDebug(sessionDebug);
.....
In the above acode I am getting PRT error when i get instance of session by session.getDefaultInstance method.
I didnt configure anything in the server(like javamail client). Help me out on this...
Thanks in Advance..
Regards
Vasu
1.do not use
Properties props = System.getProperties();
instead use
Properties props = new Properties();
props.put("mail.smtp.auth","true");
props.put("mail.transport.protocol", "smtp");
2. Why are you setting mail.smtp.auth to true. Most of the SMTP servers do not need authentication when sending mails provided the e-mail address of the sender is a valid address.
Akhilesh
Dont forget to awars points if useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akhilesh,
Thanks for the info. I tried what u told. But,i still have a problem.
String host = "<host ip address>";
boolean sessionDebug = false;
Properties props = new Properties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth","true");
props.put("mail.transport.protocol", "smtp");
Session session = Session.getDefaultInstance(props, null); //i am getting the error in this line
session.setDebug(sessionDebug);
Any ideas please?
<b>Regards,
Sai Krishna.</b>
Hi All,
Any ideas or solutions please?
I am also trying to trigger email from PDK.
I am also able to trigger emails from webdynpro, but the same code is not working in AbstractPortalComponent.
I would be very grateful if you guys give some ideas.
<b>Regards,
Sai Krishna.</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vasu,
Did you try to use the mail session from the j2ee engine. Add the smtp server name in the JAVAMAIL service in Visual Admin and try with that. There is an example in the J2EE examples page link which is there in the index.html of the j2ee engine.
I think you are getting the error because you are not using the portal mail session.
Regards
Prakash
Any Solutions???
Regards
Vasu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.