Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
7b52d617
Unverified
Commit
7b52d617
authored
Jul 26, 2023
by
l2063610646
Committed by
GitHub
Jul 26, 2023
Browse files
fix(EmailServiceImpl): 解决由于jdk8之后默认禁用了部分tls协议,从而导致发送邮件失败的问题 (#809)
1、测试jdk版本:jdk1.8.0_351
parent
d6cb5736
Changes
1
Hide whitespace changes
Inline
Side-by-side
eladmin-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java
View file @
7b52d617
...
@@ -86,6 +86,8 @@ public class EmailServiceImpl implements EmailService {
...
@@ -86,6 +86,8 @@ public class EmailServiceImpl implements EmailService {
account
.
setSslEnable
(
true
);
account
.
setSslEnable
(
true
);
// 使用STARTTLS安全连接
// 使用STARTTLS安全连接
account
.
setStarttlsEnable
(
true
);
account
.
setStarttlsEnable
(
true
);
// 解决jdk8之后默认禁用部分tls协议,导致邮件发送失败的问题
account
.
setSslProtocols
(
"TLSv1 TLSv1.1 TLSv1.2"
);
String
content
=
emailVo
.
getContent
();
String
content
=
emailVo
.
getContent
();
// 发送
// 发送
try
{
try
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment