This commit is contained in:
Looly
2023-04-17 13:48:14 +08:00
parent d2fd9d448d
commit fecc2ef0e0
8 changed files with 122 additions and 57 deletions

View File

@@ -19,6 +19,7 @@ public class MailAccountTest {
final MailAccount account = GlobalMailAccount.INSTANCE.getAccount();
account.getSmtpProps();
Assertions.assertNotNull(account.getPass());
Assertions.assertNotNull(account.getCharset());
Assertions.assertTrue(account.isSslEnable());
}
@@ -35,7 +36,7 @@ public class MailAccountTest {
public void customPropertyTest() throws GeneralSecurityException {
final MailAccount mailAccount = new MailAccount();
mailAccount.setFrom("xxx@xxx.com");
mailAccount.setPass("xxxxxx");
mailAccount.setPass("xxxxxx".toCharArray());
mailAccount.setHost("smtp.aol.com");

View File

@@ -53,7 +53,7 @@ public class MailTest {
account.setSslEnable(true);
account.setFrom("hutool@yeah.net");
account.setUser("hutool");
account.setPass("q1w2e3");
account.setPass("q1w2e3".toCharArray());
MailUtil.send(account, "hutool@foxmail.com", "测试", "<h1>邮件来自Hutool测试</h1>", true);
}