Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
common
Commits
c5fbba65
Commit
c5fbba65
authored
Oct 10, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化方法名
parent
e4af8797
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
MailUtil.java
src/main/java/com/egolm/common/MailUtil.java
+2
-2
No files found.
src/main/java/com/egolm/common/MailUtil.java
View file @
c5fbba65
...
@@ -39,7 +39,7 @@ public class MailUtil {
...
@@ -39,7 +39,7 @@ public class MailUtil {
* @param emailTo 接收邮件地址
* @param emailTo 接收邮件地址
* @return 是否成功
* @return 是否成功
*/
*/
public
static
void
send
Mail
(
String
host
,
Integer
port
,
boolean
is_auth
,
final
String
from
,
final
String
passwd
,
String
subject
,
String
content
,
File
[]
attachments
,
String
...
emailTo
)
{
public
static
void
send
BySmtp
(
String
host
,
Integer
port
,
boolean
is_auth
,
final
String
from
,
final
String
passwd
,
String
subject
,
String
content
,
File
[]
attachments
,
String
...
emailTo
)
{
Properties
properties
=
new
Properties
();
Properties
properties
=
new
Properties
();
properties
.
put
(
"mail.smtp.host"
,
host
);
properties
.
put
(
"mail.smtp.host"
,
host
);
properties
.
put
(
"mail.smtp.auth"
,
is_auth
?
"true"
:
"false"
);
properties
.
put
(
"mail.smtp.auth"
,
is_auth
?
"true"
:
"false"
);
...
@@ -99,7 +99,7 @@ public class MailUtil {
...
@@ -99,7 +99,7 @@ public class MailUtil {
// sender.send(mailMessage, "13384825689@163.com");
// sender.send(mailMessage, "13384825689@163.com");
//String json = "{\"password\": \"hong804334\",\"port\": 25,\"protocol\": \"smtp\",\"smtpAuth\": \"true\",\"smtpHost\": \"smtp.163.com\",\"sslEnable\": \"false\",\"username\": \"13384825689@163.com\"}";
//String json = "{\"password\": \"hong804334\",\"port\": 25,\"protocol\": \"smtp\",\"smtpAuth\": \"true\",\"smtpHost\": \"smtp.163.com\",\"sslEnable\": \"false\",\"username\": \"13384825689@163.com\"}";
File
[]
files
=
new
File
[]{
new
File
(
"C:/opt/modules/dev/boot/file/excel/40001-收银员资料维护-20180813.xlsx"
),
new
File
(
"C:/opt/modules/dev/boot/file/2018-08-15/admin_客单价对比图表.html"
),
new
File
(
"C:/opt/modules/dev/boot/file/2018-08-15/admin_销售对比图表.html"
)};
File
[]
files
=
new
File
[]{
new
File
(
"C:/opt/modules/dev/boot/file/excel/40001-收银员资料维护-20180813.xlsx"
),
new
File
(
"C:/opt/modules/dev/boot/file/2018-08-15/admin_客单价对比图表.html"
),
new
File
(
"C:/opt/modules/dev/boot/file/2018-08-15/admin_销售对比图表.html"
)};
MailUtil
.
send
Mail
(
"smtp.163.com"
,
25
,
true
,
"13384825689@163.com"
,
"hong804334"
,
"测试aaa"
,
"测hi"
,
files
,
"13384825689@163.com"
);
MailUtil
.
send
BySmtp
(
"smtp.163.com"
,
25
,
true
,
"13384825689@163.com"
,
"hong804334"
,
"测试aaa"
,
"测hi"
,
files
,
"13384825689@163.com"
);
}
}
}
}
Write
Preview
Markdown
is supported
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