Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-notifycenter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 76e40a50
authored
Feb 25, 2022
by
yangll
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
发送邮件时 适配发送人为多个的情况
1 parent
852fe73c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
src/main/java/cn/com/glsx/notify/modules/service/MailService.java
src/test/java/cn/com/glsx/test/NotifyApplicationTests.java
src/main/java/cn/com/glsx/notify/modules/service/MailService.java
View file @
76e40a5
...
@@ -88,7 +88,11 @@ public class MailService {
...
@@ -88,7 +88,11 @@ public class MailService {
* @param subject 主题
* @param subject 主题
*/
*/
public
void
sendSimpleMailOnlyContent
(
String
to
,
String
subject
,
String
content
)
{
public
void
sendSimpleMailOnlyContent
(
String
to
,
String
subject
,
String
content
)
{
mailUtils
.
sendTextMail
(
to
,
subject
,
content
);
//以逗号切割 兼容收件人为多个的情况
String
[]
split
=
to
.
split
(
","
);
for
(
String
toOne
:
split
)
{
mailUtils
.
sendTextMail
(
toOne
,
subject
,
content
);
}
MessageLog
log
=
new
MessageLog
();
MessageLog
log
=
new
MessageLog
();
log
.
setSubject
(
subject
);
log
.
setSubject
(
subject
);
...
...
src/test/java/cn/com/glsx/test/NotifyApplicationTests.java
View file @
76e40a5
...
@@ -91,7 +91,7 @@ public class NotifyApplicationTests {
...
@@ -91,7 +91,7 @@ public class NotifyApplicationTests {
@Test
@Test
public
void
testMailOnlyContent
()
throws
Exception
{
public
void
testMailOnlyContent
()
throws
Exception
{
mailService
.
sendSimpleMailOnlyContent
(
"592761523@qq.com"
,
"notifycenter test"
+
DateUtils
.
format
(
new
Date
()),
"杨林龙测试"
);
mailService
.
sendSimpleMailOnlyContent
(
"592761523@qq.com
,yangll@didihu.com.cn
"
,
"notifycenter test"
+
DateUtils
.
format
(
new
Date
()),
"杨林龙测试"
);
Thread
.
sleep
(
30000
);
Thread
.
sleep
(
30000
);
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment