SmtpSimpleAuthenticator.java :  » Development » jodd » jodd » mail » Java Open Source

Java Open Source » Development » jodd 
jodd » jodd » mail » SmtpSimpleAuthenticator.java
// Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.

package jodd.mail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * Performs simple authentication when the SMTP server requires it.
 */
public class SmtpSimpleAuthenticator extends Authenticator {

  private String username;
  private String password;

  public SmtpSimpleAuthenticator(String username, String password) {
    super();
    this.username = username;
    this.password = password;
  }

  @Override
  public PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(username, password);
  }
}

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.