Package javax.mail

Examples of javax.mail.PasswordAuthentication


    this.mailSession = Session.getInstance(mailProps, new javax.mail.Authenticator()
    {
      @Override
      protected PasswordAuthentication getPasswordAuthentication()
      {
        return new PasswordAuthentication(getProperty("mailbox_user"), getProperty("mailbox_password"));
      }
    });
    if (isOutbound())
    {
      prepareEmailTemplate();
View Full Code Here


            this.session = Session.getInstance(properties);
        } else {
            properties.put("mail.smtp.auth", "true");
            this.session = Session.getInstance(properties, new Authenticator() {
                protected PasswordAuthentication getPasswordAuthentication() {
                    return new PasswordAuthentication(smtpUser, smtpPswd);
                }
            });
        }
    }
View Full Code Here

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

            return new PasswordAuthentication(user, 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

            return instance;
        }

        Authenticator authenticator = null;
        if (mailSmtpAuth) {
            final PasswordAuthentication pauth = new PasswordAuthentication(mailUser, mailPassword);
            authenticator = new Authenticator() {
                @Override
                protected PasswordAuthentication getPasswordAuthentication() {
                    return pauth;
                }
View Full Code Here

    if ((getSMTPPassword() != null) && (getSMTPUsername() != null)) {
      auth = new Authenticator() {
       
        @Override
        protected PasswordAuthentication getPasswordAuthentication() {
          return new PasswordAuthentication(getSMTPUsername(), getSMTPPassword());
        }
      };
    }
    session = Session.getInstance(props, auth);
    if (getSMTPProtocol() != null) {
View Full Code Here

            mailProps.put("mail.smtp.socketFactory.fallback", "false");

            //EH NECESSARIO AUTENTICAR
            Session mailSession = Session.getInstance(mailProps, new Authenticator() {                 
                public PasswordAuthentication getPasswordAuthentication(){             
                    return new PasswordAuthentication(emailRemetente, senhaRemetente);
                }
            });
            mailSession.setDebug(false);

            //CONFIG. DA MENSAGEM
View Full Code Here

      throws NoSuchProviderException {
    final Session session = Session.getDefaultInstance(properties,
        new Authenticator() {
          @Override
          protected PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(
                properties
                    .getProperty(Constants.EMAIL_USERNAME_PROPERTY),
                properties
                    .getProperty(Constants.EMAIL_PASSWORD_PROPERTY));
          }
View Full Code Here

      Session session = Session.getDefaultInstance(this.props,
        new javax.mail.Authenticator()
        {
      protected PasswordAuthentication getPasswordAuthentication()
      {
          return new PasswordAuthentication(MAIL_USER, MAIL_PWD);
      }
        });
      MimeMessage msg = new MimeMessage(session);
      msg.setSubject(rb.getString("regConfirmSubject"));
      msg.setText(rb.getString("regConfirmMsg") + rb.getString("regConfirmGreetings"));
View Full Code Here

      Session session = Session.getDefaultInstance(this.props,
        new javax.mail.Authenticator()
        {
      protected PasswordAuthentication getPasswordAuthentication()
      {
          return new PasswordAuthentication(MAIL_USER, MAIL_PWD);
      }
        });
      MimeMessage msg = new MimeMessage(session);
      msg.setSubject(rb.getString("delNotifySubject"));
      msg.setText(rb.getString("delNotifyMsg") + rb.getString("delNotifyGreetings"));
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.