1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.vci.client.workflow.mail;
 
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
 
public class MyAuthenticator  extends Authenticator{
    private String userName;
     private String password;
     
     public MyAuthenticator() {
      System.out.println("myAuthenticator is construct");
     }
     
     @Override
     protected PasswordAuthentication getPasswordAuthentication() {
      // TODO Auto-generated method stub
      return new PasswordAuthentication(userName, password);
     }
     public String getUserName() {
      return userName;
     }
     public void setUserName(String userName) {
      this.userName = userName;
     }
     public String getPassword() {
      return password;
     }
     public void setPassword(String password) {
      this.password = password;
     }
     
     
}