Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
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
曲欣亮
member-api
Commits
9938b6ea
Commit
9938b6ea
authored
Jan 18, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
c64e629f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
EmailServiceImpl.java
...ava/com/egolm/film/api/service/impl/EmailServiceImpl.java
+4
-0
No files found.
src/main/java/com/egolm/film/api/service/impl/EmailServiceImpl.java
View file @
9938b6ea
...
...
@@ -6,6 +6,7 @@ import java.util.HashMap;
import
java.util.Locale
;
import
java.util.Map
;
import
org.apache.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.dao.EmptyResultDataAccessException
;
...
...
@@ -26,6 +27,8 @@ import com.egolm.film.util.Common;
@Service
public
class
EmailServiceImpl
implements
EmailService
{
private
static
final
Logger
logger
=
Logger
.
getLogger
(
EmailService
.
class
);
@Value
(
"${com.egolm.film.email.smtp.host}"
)
private
String
host
;
@Value
(
"${com.egolm.film.email.smtp.port}"
)
private
Integer
port
;
...
...
@@ -54,6 +57,7 @@ public class EmailServiceImpl implements EmailService {
MailUtil
.
sendBySmtps
(
host
,
port
,
username
,
password
,
from
,
subject
,
content
,
null
,
StringUtil
.
isNotBlank
(
testEmail
)
?
testEmail
:
email
);
record
.
setSend_state
(
1
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"邮件发送失败"
,
e
);
record
.
setSend_state
(
2
);
}
finally
{
jdbcTemplate
.
update
(
record
);
...
...
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