Package javax.mail

Examples of javax.mail.PasswordAuthentication


      this.password = password;
    }

    @Override
    public PasswordAuthentication getPasswordAuthentication() {
      return new PasswordAuthentication(username, password);
    }
View Full Code Here


                        if(user == null) {
                            user = props.getProperty("mail.user");
                        }
                       
                        if(user != null) {
                            final PasswordAuthentication pa = new PasswordAuthentication(user, password);
                            auth = new Authenticator() {
                                    protected PasswordAuthentication getPasswordAuthentication() {
                                        return pa;
                                    }
                                };
View Full Code Here

      }

    Session session = Session.getInstance(props,
        new Authenticator() {
          protected PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(user, password);
          }
        });

    if (debug) {
      session.setDebug(true);
View Full Code Here

    }

    public void send(String subject, String targetEmail, String message, String charSet)
            throws AxisFault {
        try {
            final PasswordAuthentication authentication = new PasswordAuthentication(user,
                    password);
            Properties props = new Properties();

            props.put("mail.user", user);
            props.put("mail.host", host);
View Full Code Here

        }
    }

    public void connect() throws AxisFault {
        try {
            final PasswordAuthentication authentication = new PasswordAuthentication(user,
                    password);
            Properties props = new Properties();

            props.put("mail.user", user);
            props.put("mail.host", host);
View Full Code Here

        this(user, host, password, false);
    }

    public MailClient(String user, String host, String password, boolean debug) {
        from = user + '@' + host;
        authentication = new PasswordAuthentication(user, password);

        Properties props = new Properties();

        props.put("mail.user", user);
        props.put("mail.host", host);
View Full Code Here

                    properties.put(prop.getKey(), prop.getValue());
                }
            }

            if (metaData.getUser() != null) {
                authenticator = new PasswordAuthentication(metaData.getUser(), metaData.getPassword());
            }
        }
View Full Code Here

 
  /* (Kein Javadoc)
   * @see javax.mail.Authenticator#getPasswordAuthentication()
   */
  public PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(_user, _pwd);
  }
View Full Code Here

         * (Kein Javadoc)
         *
         * @see javax.mail.Authenticator#getPasswordAuthentication()
         */
        public PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(_user, _pwd);
        }
View Full Code Here

        this.props = props;
    }

    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        PasswordAuthentication authenticator = null;
        String protocol = getRequestingProtocol();
        if(protocol != null) {
            String password = props.getProperty("mail." + protocol + ".password");
            String username = getDefaultUserName();
            if(password != null && username != null) {
                authenticator = new PasswordAuthentication(username, password);
            }
        }
        return authenticator;
    }
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.