Я хочу вставить ссылку в электронное письмо с JSP.Я успешно получаю сообщение HTML в своем электронном письме, но ссылка не отображается ... Я использую почту Java ... Мой код такой:
public void sendConfirmationMail() throws MalformedURLException, IOException{
try {
Properties properties = System.getProperties();
properties.put("mail.smtp.host", "smtp.gmail.com");
properties.put("mail.smtp.socketFactory.port", "465");
properties.put("mail.smtp.ssl.enable", "true");
properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.port", "465");
Session mailSession = Session.getInstance(properties,
new javax.mail.Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(fromEmail,password);
}
});
mailSession.setDebug(true);
MimeMessage mail = new MimeMessage(mailSession);
mail.setFrom(new InternetAddress(fromEmail));
mail.setRecipients(Message.RecipientType.TO,InternetAddress.parse(toEmail));
MimeBodyPart cuerpo = new MimeBodyPart();
cuerpo.setText(message,"UTF-8","html");
Multipart part = new MimeMultipart();
part.addBodyPart(cuerpo);
mail.setContent(part);
mail.setSubject(subject);
Transport.send(mail);
} catch (MessagingException ex) {
Logger.getLogger(MailController.class.getName()).log(Level.SEVERE, null, ex);
}
}
Как мне этого добиться?