ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

JavaMail Authentication Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • JavaMail Authentication Problem

    Hello,

    Im trying to use javamail to send emails to a authentication server. I have the authentication code written. I had to use an anonymous class for the authentication.

    Problem is when I compile the program it is creating two classes,(one for the anonymous class).

    Ive created my jar file to include the anonymous class. Im having problems with the 400 finding my class(jar file). How can I either, compile the java into a single class, or create my jar file accordingly.

    Code:
     
    Properties systemProperty = System.getProperties();
                systemProperty.put("mail.smtp.host", smtpHost);
                systemProperty.put("mail.smtp.port", smtpPort);
                systemProperty.put("mail.smtp.auth", smtpAuth);
    
               Session session = Session.getInstance(systemProperty,
    		  new javax.mail.Authenticator() {
    			protected PasswordAuthentication getPasswordAuthentication() {
    					return new PasswordAuthentication (userName, passWord);
    			}
    		  });

  • #2
    Re: JavaMail Authentication Problem

    Originally posted by davisty

    Ive created my jar file to include the anonymous class. Im having problems with the 400 finding my class(jar file).
    I didn't understand you correctly. but are you looking for to set environment variable?
    Code:
    /*    Set Environtment Variable                                     */
    
                 ADDENVVAR  ENVVAR(CLASSPATH) +
                              VALUE('/tmp/java/abc.jar')
                              
                 MONMSG     MSGID(CPFA980)
    or creating jar
    PHP Code:
    jar cf jar-file input-file(s
    Last edited by dhanuxp; February 26, 2013, 09:57 PM.

    Comment

    Working...
    X