Skip to Content
author's profile photo Former Member
Former Member

Urgent ::: Sending java mail from AbstractPortalComponent

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 10:25 AM

    Any Solutions???

    Regards

    Vasu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 05:52 PM

    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>

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Posted on Feb 18, 2005 at 05:30 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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>

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.