I tried with and without HTML href tag, but gmail is taking 2-3 hours to reach recipient(to) having 2 links in a email-body. And if I send only one link in a body it will reach immediately. Googled but not getting the proper solution or hint. Can anyone help me.. here is my code and email-body:
public int sendMail(String subject, String body, String to)
{
MimeMessage message = this.mailSender.createMimeMessage();
System.out.println("Welcome to sender.......");
try
{
MimeMessageHelper helper = new MimeMessageHelper(message, true);
helper.setTo(to);
// helper.setFrom("reddy@abc.com");
helper.setSubject(subject);
helper.setText(body, true);
this.mailSender.send(message);
return 1;
}
catch (MessagingException e1)
{
e1.printStackTrace();
}
return -1;
}
email -body:
body = "Dear " + candidate + ",<br/><b>Greetings</b><br/>link <a href='http://test.com'></a> <br/><a href='https://google.com'></a>";
how to optimize sending this type of emails?
Or any other way to send multiple links in a body?