-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSendVerifyEmailTest.java
More file actions
43 lines (38 loc) · 1.11 KB
/
SendVerifyEmailTest.java
File metadata and controls
43 lines (38 loc) · 1.11 KB
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
34
35
36
37
38
39
40
41
42
43
package org.fade.verify;
import org.fade.verify.utils.EmailUtil;
import org.junit.Test;
import javax.mail.MessagingException;
import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
/**
* 发送验证邮件测试类
* @author fade
* */
public class SendVerifyEmailTest {
/**
* 测试发送验证码邮件
* */
@Test
public void testSendVerifyEmail() {
//测试地址一(国内)
// String toEmail = "@foxmail.com";
//测试地址三(国内网易)
String toEmail = "@163.com";
//测试地址二(国外)
// String toEmail = "@gmail.com";
try {
EmailUtil.init();
} catch (GeneralSecurityException e) {
e.printStackTrace();
}
try{
EmailUtil.sendEmail(toEmail);
// System.setProperty("http.proxyHost", "127.0.0.1");
// System.setProperty("http.proxyPort", "7890");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (MessagingException e) {
e.printStackTrace();
}
}
}