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
b64a39c8
Commit
b64a39c8
authored
Dec 17, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
bf1c38a3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
EmailServiceImpl.java
...ava/com/egolm/film/api/service/impl/EmailServiceImpl.java
+3
-3
application-dev.properties
src/main/resources/application-dev.properties
+2
-0
No files found.
src/main/java/com/egolm/film/api/service/impl/EmailServiceImpl.java
View file @
b64a39c8
...
...
@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
com.egolm.common.MailUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.film.api.service.EmailService
;
import
com.egolm.film.bean.Fc_email_record
;
...
...
@@ -20,8 +21,7 @@ public class EmailServiceImpl implements EmailService {
@Value
(
"${com.egolm.film.email.smtp.from}"
)
private
String
from
;
@Value
(
"${com.egolm.film.email.smtp.username}"
)
private
String
username
;
@Value
(
"${com.egolm.film.email.smtp.password}"
)
private
String
password
;
@Value
(
"${spring.profiles.active}"
)
private
String
profiles
;
@Value
(
"${com.egolm.film.email.test}"
)
private
String
testEmail
;
@Autowired
JdbcTemplate
jdbcTemplate
;
...
...
@@ -40,7 +40,7 @@ public class EmailServiceImpl implements EmailService {
new
Thread
()
{
public
void
run
()
{
try
{
MailUtil
.
sendBySmtp
(
host
,
port
,
is_auth
,
username
,
password
,
from
,
subject
,
content
,
null
,
!
profiles
.
equals
(
"pro"
)
?
"sun.nana@egolm.com"
:
email
);
MailUtil
.
sendBySmtp
(
host
,
port
,
is_auth
,
username
,
password
,
from
,
subject
,
content
,
null
,
StringUtil
.
isNotBlank
(
testEmail
)
?
testEmail
:
email
);
record
.
setSend_state
(
1
);
}
catch
(
Exception
e
)
{
record
.
setSend_state
(
2
);
...
...
src/main/resources/application-dev.properties
View file @
b64a39c8
...
...
@@ -9,6 +9,8 @@ spring.http.multipart.maxRequestSize=5MB
spring.http.encoding.force
=
true
spring.http.encoding.enabled
=
true
spring.http.encoding.charset
=
utf-8
com.egolm.film.email.test
=
sun.nana@egolm.com
com.egolm.film.email.smtp.host
=
smtp.siff.com
com.egolm.film.email.smtp.port
=
25
com.egolm.film.email.smtp.is_auth
=
true
...
...
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