Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
cedbdd12
Commit
cedbdd12
authored
Dec 08, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邮件服务
parent
fb44737d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
7 deletions
+32
-7
Email.java
...c/main/java/com/yifu/cloud/plus/v1/mail/entity/Email.java
+16
-0
MailService.java
...java/com/yifu/cloud/plus/v1/mail/service/MailService.java
+3
-2
MailServiceImpl.java
...yifu/cloud/plus/v1/mail/service/impl/MailServiceImpl.java
+3
-3
application-dev.yml
...mail/yifu-mail-biz/src/main/resources/application-dev.yml
+10
-2
No files found.
yifu-mail/yifu-mail-api/src/main/java/com/yifu/cloud/plus/v1/mail/entity/Email.java
0 → 100644
View file @
cedbdd12
package
com
.
yifu
.
cloud
.
plus
.
v1
.
mail
.
entity
;
import
lombok.Data
;
/**
* @Author fxj
* @Date 2022/12/8
* @Description
* @Version 1.0
*/
@Data
public
class
Email
{
private
String
[]
user
;
private
String
subject
;
private
String
content
;
}
yifu-mail/yifu-mail-biz/src/main/java/com/yifu/cloud/plus/v1/mail/service/MailService.java
View file @
cedbdd12
package
com
.
yifu
.
cloud
.
plus
.
v1
.
mail
.
service
;
import
com.sun.xml.internal.ws.resources.SenderMessages
;
import
com.yifu.cloud.plus.v1.mail.entity.Email
;
/**
* @Author fxj
...
...
@@ -11,6 +12,6 @@ import com.sun.xml.internal.ws.resources.SenderMessages;
**/
public
interface
MailService
{
Boolean
sendMail
(
SenderMessages
messages
);
Boolean
sendMail
(
Email
email
);
}
yifu-mail/yifu-mail-biz/src/main/java/com/yifu/cloud/plus/v1/mail/service/impl/MailServiceImpl.java
View file @
cedbdd12
package
com
.
yifu
.
cloud
.
plus
.
v1
.
mail
.
service
.
impl
;
import
com.
sun.xml.internal.ws.resources.SenderMessages
;
import
com.
yifu.cloud.plus.v1.mail.entity.Email
;
import
com.yifu.cloud.plus.v1.mail.service.MailService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.mail.SimpleMailMessage
;
...
...
@@ -18,9 +18,9 @@ public class MailServiceImpl implements MailService {
private
JavaMailSender
mailSender
;
@Override
public
Boolean
sendMail
(
SenderMessages
messages
)
{
public
Boolean
sendMail
(
Email
email
)
{
SimpleMailMessage
mailMessage
=
new
SimpleMailMessage
();
mailMessage
.
setFrom
(
"
fangxinjiang
@wanxin-holdings.com"
);
mailMessage
.
setFrom
(
"
information
@wanxin-holdings.com"
);
mailMessage
.
setTo
(
"fangxinjiang@wanxin-holdings.com"
);
mailMessage
.
setText
(
"你好 hello world"
);
mailMessage
.
setSubject
(
"测试Spring邮箱服务"
);
...
...
yifu-mail/yifu-mail-biz/src/main/resources/application-dev.yml
View file @
cedbdd12
...
...
@@ -10,12 +10,19 @@ spring:
host
:
127.0.0.1
password
:
'
@yf_2017'
mail
:
host
:
smtp.
wanxin-holdings
.com
host
:
smtp.
exmail.qq
.com
port
:
465
username
:
information@wanxin-holdings.com
password
:
QmdCaQSPmCAQEddd
protocol
:
smtp
default-encoding
:
UTF-8
properties
:
mail.smtp.auth
:
true
mail.smtp.starttls.enable
:
true
mail.smtp.starttls.required
:
true
mail.smtp.socketFactory.port
:
465
mail.smtp.socketFactory.class
:
javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback
:
false
datasource
:
type
:
com.zaxxer.hikari.HikariDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
...
...
@@ -44,4 +51,5 @@ security:
urls
:
-
/v3/api-docs
-
/actuator/**
-
/swagger-ui/**
\ No newline at end of file
-
/swagger-ui/**
-
/sendMail/**
\ No newline at end of file
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