View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.email;
8   
9   import javax.mail.PasswordAuthentication;
10  
11  /**
12   * DefaultAuthenticator is used to do simple authentication when the SMTP server
13   * requires it.
14   */
15  class DefaultAuthenticator extends javax.mail.Authenticator
16  {
17      private String username = null;
18      private String password = null;
19  
20      public DefaultAuthenticator(String user, String pwd)
21      {
22          username = user;
23          password = pwd;
24      }
25  
26      public PasswordAuthentication getPasswordAuthentication()
27      {
28          return new PasswordAuthentication(username, password);
29      }
30  }