mirror of
https://github.com/vran-dev/databasir.git
synced 2025-08-10 00:35:06 +08:00
feature: support use ssl in smtp config (#58)
* feat: support config use ssl * feat: update frontend resources
This commit is contained in:
@@ -13,5 +13,7 @@ public class SystemEmailResponse {
|
||||
|
||||
private Integer smtpPort;
|
||||
|
||||
private Boolean useSSL;
|
||||
|
||||
private LocalDateTime createAt;
|
||||
}
|
||||
|
@@ -21,4 +21,7 @@ public class SystemEmailUpdateRequest {
|
||||
@Max(65535L)
|
||||
private Integer smtpPort;
|
||||
|
||||
@NotNull
|
||||
private Boolean useSSL;
|
||||
|
||||
}
|
||||
|
@@ -79,6 +79,7 @@ public class SystemService {
|
||||
response.setSmtpPort(mail.getSmtpPort());
|
||||
response.setUsername(mail.getUsername());
|
||||
response.setCreateAt(mail.getCreateAt());
|
||||
response.setUseSSL(mail.getUseSsl());
|
||||
return response;
|
||||
});
|
||||
}
|
||||
|
@@ -30,7 +30,11 @@ public class MailSender {
|
||||
}
|
||||
sender.setUsername(properties.getUsername());
|
||||
sender.setPassword(properties.getPassword());
|
||||
sender.setProtocol("smtp");
|
||||
if (properties.getUseSsl()) {
|
||||
sender.setProtocol("smtps");
|
||||
} else {
|
||||
sender.setProtocol("smtp");
|
||||
}
|
||||
sender.setDefaultEncoding(StandardCharsets.UTF_8.name());
|
||||
return sender;
|
||||
}
|
||||
|
Reference in New Issue
Block a user