I am using Apache common-email lib. And my SMTP server requires me to endable TLS protocol.
However, doing so gives me a warning that this particular method deprecated. Would someone please let me know an alternative to this?
import org.apache.commons.mail._
val commonsMail = new SimpleEmail().setMsg(mail.message)
commonsMail.setHostName("smtp.office365.com")
commonsMail.setSmtpPort(25)
commonsMail.setTLS(true) //This line shows warning.