Class DefaultAuthenticator

java.lang.Object
jakarta.mail.Authenticator
org.apache.commons.mail2.jakarta.DefaultAuthenticator

public class DefaultAuthenticator extends jakarta.mail.Authenticator
This is a very simple authentication object that can be used for any transport needing basic userName and password type authentication.
Since:
1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultAuthenticator(String userName, String password)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected jakarta.mail.PasswordAuthentication
    Gets the authentication object that will be used to login to the mail server.

    Methods inherited from class jakarta.mail.Authenticator

    getDefaultUserName, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingSite

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultAuthenticator

      public DefaultAuthenticator(String userName, String password)
      Default constructor.
      Parameters:
      userName - user name to use when authentication is requested
      password - password to use when authentication is requested
      Since:
      1.0
  • Method Details

    • getPasswordAuthentication

      protected jakarta.mail.PasswordAuthentication getPasswordAuthentication()
      Gets the authentication object that will be used to login to the mail server.
      Overrides:
      getPasswordAuthentication in class jakarta.mail.Authenticator
      Returns:
      A PasswordAuthentication object containing the login information.
      Since:
      1.0