Package javax.mail

Examples of javax.mail.PasswordAuthentication


      throw new RuntimeException("[Error] Username or password is empty!");
    }
    properties.put("mail.smtp.auth", "true");
    authenticator = new Authenticator() {
      protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(username, password);
      }
    };
  }
View Full Code Here


      throw new RuntimeException("[Error] Username or password is empty!");
    }
    properties.put("mail.smtp.auth", "true");
    authenticator = new Authenticator() {
      protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(username, password);
      }
    };
  }
View Full Code Here

        this.password = password;
      }
  
      public PasswordAuthentication getPasswordAuthentication()
      {
        return new PasswordAuthentication(username, password);
      }
View Full Code Here

     * Returns an authenticator object for use in sessions
     */
    public Authenticator getAuthenticator() {
        return new Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(getUsername(), getPassword());
            }
        };
    }
View Full Code Here

            this.user = user;
            this.password = password;
        }
        public PasswordAuthentication getPasswordAuthentication() {

            return new PasswordAuthentication(user, password);
        }
View Full Code Here

     * @param password password to use when authentication is requested
     * @since 1.0
     */
    public DefaultAuthenticator(final String userName, final String password)
    {
        this.authentication = new PasswordAuthentication(userName, password);
    }
View Full Code Here

    private Authenticator createAuthenticator(final EmailTransmitterConfiguration config) {
        Authenticator authenticator = null;
        if (config.isAuthorizationRequired()) {

            authenticator = new Authenticator() {
                private PasswordAuthentication pa = new PasswordAuthentication(config.getUserName(), config.getPassword());

                @Override
                public PasswordAuthentication getPasswordAuthentication() {
                    return pa;
                }
View Full Code Here

        private static Authenticator getAuthenticator(final String smtpAuthUserName, final String smtpAuthPassword) {
            if(smtpAuthUserName==null)    return null;
            return new Authenticator() {
                @Override
                protected PasswordAuthentication getPasswordAuthentication() {
                    return new PasswordAuthentication(smtpAuthUserName,smtpAuthPassword);
                }
            };
        }
View Full Code Here

           
        }
       
        public PasswordAuthenticator(String user, String password)
        {
            passwordAuthentication = new PasswordAuthentication (user, (password.startsWith(Password.__OBFUSCATE)?Password.deobfuscate(password):password));
        }
View Full Code Here

  {
    final String protocol = getRequestingProtocol();

    final String userName = properties.getProperty("mail." + protocol + ".user", properties.getProperty("mail.user"));
    final String password = properties.getProperty("mail." + protocol + ".password", properties.getProperty("mail.password"));
    return new PasswordAuthentication(userName, password);
  }
View Full Code Here

TOP

Related Classes of javax.mail.PasswordAuthentication

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.