package fmc.prototypes.javamail; import javax.mail.Authenticator; import javax.mail.PasswordAuthentication; /** * Authentication based on the user name and pass * * @author kreuz */ public class MyAuthenticator extends Authenticator { /** * Holder for the inner variable */ String userName; /** * Holder for the inner variable */ String pass; /** * Constructor * * @param userName user name for authentication * @param pass user pass for authentication */ public MyAuthenticator(String userName, String pass) { this.userName = userName; this.pass = pass; } /** * @see Authenticator@getPasswordAuthentication() */ public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(userName, pass); } }