Customize mail sender protocol
See gh-3649
This commit is contained in:
@@ -55,6 +55,11 @@ public class MailProperties {
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* Protocol used by the SMTP server.
|
||||
*/
|
||||
private String protocol;
|
||||
|
||||
/**
|
||||
* Default MimeMessage encoding.
|
||||
*/
|
||||
@@ -107,6 +112,14 @@ public class MailProperties {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getProtocol() {
|
||||
return this.protocol;
|
||||
}
|
||||
|
||||
public void setProtocol(String protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
|
||||
public Charset getDefaultEncoding() {
|
||||
return this.defaultEncoding;
|
||||
}
|
||||
|
||||
@@ -79,6 +79,9 @@ public class MailSenderAutoConfiguration {
|
||||
}
|
||||
sender.setUsername(this.properties.getUsername());
|
||||
sender.setPassword(this.properties.getPassword());
|
||||
if (this.properties.getProtocol() != null) {
|
||||
sender.setProtocol(this.properties.getProtocol());
|
||||
}
|
||||
if (this.properties.getDefaultEncoding() != null) {
|
||||
sender.setDefaultEncoding(this.properties.getDefaultEncoding().name());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user