-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from fsinfopassau/dev
Added various fixes & updates
- Loading branch information
Showing
52 changed files
with
939 additions
and
593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,15 +21,21 @@ | |
@Service | ||
public class MailService { | ||
|
||
@Value("${MAIL_USER_NAME:Username}") | ||
@Value("${MAIL_SENDER_ADDR:[email protected]}") | ||
private String mailSenderAddr; | ||
|
||
@Value("${MAIL_USER_NAME:}") | ||
private String mailUserName; | ||
|
||
@Value("${MAIL_USER_PASSWORD:password}") | ||
@Value("${MAIL_USER_PASSWORD:}") | ||
private String mailUserPassword; | ||
|
||
@Value("${MAIL_HOST_NAME:smtp.test.com}") | ||
private String mailHostName; | ||
|
||
@Value("${MAIL_USE_SSL:true}") | ||
private boolean useSsl; | ||
|
||
@Value("${MAIL_HOST_PORT:587}") | ||
private int mailHostPort; | ||
|
||
|
@@ -123,12 +129,16 @@ private boolean sendMail(String address, String subject, String text) { | |
try { | ||
email.setHostName(mailHostName); | ||
email.setSmtpPort(mailHostPort); | ||
email.setAuthentication(mailUserName, mailUserPassword); | ||
email.setFrom(mailUserName); | ||
if (mailUserName != null && !mailUserName.isEmpty()) { | ||
email.setAuthentication(mailUserName, mailUserPassword == null ? "" : mailUserPassword); | ||
} | ||
email.setFrom(mailSenderAddr); | ||
email.addTo(address); | ||
email.setMsg(text); | ||
email.setSSLOnConnect(true); | ||
email.setStartTLSEnabled(true); | ||
if (useSsl) { | ||
email.setSSLOnConnect(true); | ||
email.setStartTLSEnabled(true); | ||
} | ||
email.setSubject(subject); | ||
|
||
email.send(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.