Вот мой код р>
Код: Выделить всё
try {
// Create the email message
HtmlEmail email = new HtmlEmail();
email.setSmtpPort(465); //email.setSslSmtpPort("465");
email.setSSLOnConnect(true);
email.setHostName("smtp.gmail.com");
email.addTo("[email protected]", "test");
email.setFrom(getEmail(), getName());
email.setSubject(getSubject());
email.setHtmlMsg("Test"); // set the html message
email.setTextMsg(getText());// set the alternative message
email.send();// send the email
} catch (EmailException e) {
logger.error("Exception sending email: ", e);
} catch (Exception ex) {
logger.error("Exception sending email: ", ex);
}
org.apache.commons.mail.EmailException: не удалось отправить электронное письмо на
следующий сервер: smtp.gmail.com:465
Подробнее здесь: https://stackoverflow.com/questions/359 ... wing-serve