Reputation: 73
While sending email from java to Yahoo mail , the link inside is not working. URL not clickable in Yahoo while it's fine in Gmail.
Here's code to send the mail:
MimeMessage mime = this.mailSender.createMimeMessage();
MimeMessageHelper message = new MimeMessageHelper(mime, true);
message.setTo(to);
message.setSubject(subject);
message.setText("verification link: http://localhost:8080/myproject/verification.zulverId=6c1", true);
this.mailSender.send(mime);
Upvotes: 2
Views: 1375
Reputation: 1777
use
message.setContent("verification link: http://localhost:8080/myproject/verification.zulverId=6c1", "text/html; charset=utf-8");
message.saveChanges();
setText internally calls setContent method.So use it directly.
Upvotes: 1