Revision 59824
Added by Konstantinos Triantafyllou over 3 years ago
EmailSender.java | ||
---|---|---|
29 | 29 |
properties.put("mail.transport.protocol", "smtp"); |
30 | 30 |
properties.put("mail.smtp.host", host); |
31 | 31 |
properties.put("mail.smtp.port", port); |
32 |
properties.put("mail.smtp.auth", auth); |
|
32 | 33 |
//Dev for sending email from gmail |
33 | 34 |
if(host.equals("smtp.gmail.com")) { |
34 |
properties.put("mail.smtp.auth", "true"); //enable authentication |
|
35 | 35 |
properties.put("mail.smtp.starttls.enable", "true"); |
36 | 36 |
properties.put("mail.smtp.ssl.trust", "*"); |
37 |
} else { |
|
38 |
properties.put("mail.smtp.auth", "false"); |
|
39 | 37 |
} |
40 | 38 |
Session session = javax.mail.Session.getInstance(properties, |
41 | 39 |
new Authenticator() { |
Also available in: Unified diff
[User management]: Email sender get auth from properties