|
Email email = new HtmlEmail(); |
|
email.setHostName(hostname); |
|
email.setAuthenticator(new DefaultAuthenticator(username, password)); |
|
email.setSmtpPort(port); |
|
email.setFrom(from, fromname); |
|
email.setSubject(title); |
|
email.setMsg(content); |
|
email.addTo(mailAddress.split(mailAddressEndSeparator)); |
|
email.send(); |
Establishing an unencrypted connection to a mail server allows an attacker to carry out a man-in-the-middle attack and read all the mail transmissions.
SSL/TLS connection is a better choice
shepher/shepher-service/src/main/java/com/xiaomi/shepher/common/GeneralMailSender.java
Lines 60 to 68 in 5311757
Establishing an unencrypted connection to a mail server allows an attacker to carry out a man-in-the-middle attack and read all the mail transmissions.
SSL/TLS connection is a better choice