Hi all!
I have a problem and perhaps you can help me. I wrote a class to send email in my application using commons-email. Here is the code:
import org.apache.commons.mail.SimpleEmail;
(...)
SimpleEmail email = new SimpleEmail();
try {
email.setHostName(smtp);
email.setAuthentication(user, pwd);
email.addTo(to, aliasTo);
email.setFrom(from, aliasFrom);
email.setSubject(subject");
email.setMsg(message);
email.send();
} catch (Exception e) {
e.printStackTrace();
}