Blame view

src/com/fh/util/mail/MyAuthenticator.java 652 Bytes
ad5081d3   孙向锦   初始化项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  package com.fh.util.mail;
  /**
   * 发送邮件需要使用的基本信息 
  * @author FH QQ 313596790[青苔]
  * 创建时间:2014620
  * @version 2.0
   */
  import javax.mail.*;   
  
  public class MyAuthenticator extends Authenticator{   
      String userName=null;   
      String password=null;   
          
      public MyAuthenticator(){   
      }   
      public MyAuthenticator(String username, String password) {    
          this.userName = username;    
          this.password = password;    
      }    
      protected PasswordAuthentication getPasswordAuthentication(){   
          return new PasswordAuthentication(userName, password);   
      }   
  }