Class UsernamePasswordAuthenticator


  • public class UsernamePasswordAuthenticator
    extends javax.mail.Authenticator

    A username-password Authenticator for SMTP authentication.

    This implementation is not synchronized. If used by different threads concurrently, external synchronization is necessary.

    Author:
    sts
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.mail.PasswordAuthentication getPasswordAuthentication()  
      • Methods inherited from class javax.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 Detail

      • UsernamePasswordAuthenticator

        public UsernamePasswordAuthenticator​(java.lang.String userName,
                                             java.lang.String password)
        Creates a new UsernamePasswordAuthenticator with the specified user name and password
        Parameters:
        userName - user name for authentication
        password - password for authentication
    • Method Detail

      • getPasswordAuthentication

        public javax.mail.PasswordAuthentication getPasswordAuthentication()
        Overrides:
        getPasswordAuthentication in class javax.mail.Authenticator