mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
change default
This commit is contained in:
parent
3fca9e3afd
commit
0ce21b9b41
@ -18,6 +18,7 @@
|
||||
* 【core 】 修改RegexPool中Ipv4正则
|
||||
* 【json 】 Filter改为MutablePair,以便编辑键值对(issue#1921@Github)
|
||||
* 【core 】 Opt增加peeks方法(pr#445@Gitee)
|
||||
* 【extra 】 MailAccount中user默认值改为邮箱全称(issue#I4FYVY@Gitee)
|
||||
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复UrlBuilder.addPath歧义问题(issue#1912@Github)
|
||||
|
@ -608,8 +608,9 @@ public class MailAccount implements Serializable {
|
||||
this.host = StrUtil.format("smtp.{}", StrUtil.subSuf(fromAddress, fromAddress.indexOf('@') + 1));
|
||||
}
|
||||
if (StrUtil.isBlank(user)) {
|
||||
// 如果用户名为空,默认为发件人邮箱前缀
|
||||
this.user = StrUtil.subPre(fromAddress, fromAddress.indexOf('@'));
|
||||
// 如果用户名为空,默认为发件人(issue#I4FYVY@Gitee)
|
||||
//this.user = StrUtil.subPre(fromAddress, fromAddress.indexOf('@'));
|
||||
this.user = fromAddress;
|
||||
}
|
||||
if (null == this.auth) {
|
||||
// 如果密码非空白,则使用认证模式
|
||||
|
@ -39,7 +39,7 @@ public class MailTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
// @Ignore
|
||||
public void sendHtmlTest() {
|
||||
MailUtil.send("hutool@foxmail.com", "测试", "<h1>邮件来自Hutool测试</h1>", true);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ port = 465
|
||||
# 发件人(必须正确,否则发送失败)
|
||||
from = 小磊<hutool@yeah.net>
|
||||
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
|
||||
user = hutool
|
||||
user = hutool@yeah.net
|
||||
# 密码
|
||||
pass = q1w2e3
|
||||
# 使用 STARTTLS安全连接
|
||||
|
Loading…
x
Reference in New Issue
Block a user