mailauthenticator.java

来自「100多M的J2EE培训内容」· Java 代码 · 共 81 行

JAVA
81
字号
package bible.javamail;



import javax.mail.*;


/**
 * Class MailAuthenticator
 *
 *
 * @author
 * @version %I%, %G%
 */
public class MailAuthenticator extends Authenticator {

  private String user;
  private String password;

  /**
   * Method setUser
   *
   *
   * @param s
   *
   */
  public void setUser(String s) {
    user = s;
  }

  /**
   * Method getUser
   *
   *
   * @return
   *
   */
  public String getUser() {
    return user;
  }

  /**
   * Method setPassword
   *
   *
   * @param s
   *
   */
  public void setPassword(String s) {
    password = s;
  }

  /**
   * Method getPassword
   *
   *
   * @return
   *
   */
  public String getPassword() {
    return password;
  }

  /**
   * Method getPasswordAuthentication
   *
   *
   * @return
   *
   */
  public PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(user, password);
  }
}


/*--- Formatted in Bible Style on Thu, Sep 6, '01 ---*/


/*------ Formatted by Jindent 3.24 Gold 1.02 --- http://www.jindent.de ------*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?