Hi, I'm not sure if this is good place to post my question, but I hope it's ok. So I want to send email in method annotated with @Async. This method looks like this:
After invoking this method "sending registration email" appears but "sending registration email 2" doesn't. Can anybody can tell me why? Any help would be appreciated. Thank you in advance.Code:@Async public void sendRegistrationEmail(String name, String email, String password) throws MessagingException { System.out.println("sending registration email"); MimeMultipart multipart = new MimeMultipart("registration"); MimeBodyPart messageBodyPart = new MimeBodyPart(); StringBuffer htmlText = new StringBuffer(MessagesUtils.getMessage("mcv.msg.registerOk1")); htmlText.append(name); htmlText.append(MessagesUtils.getMessage("mcv.msg.registerOk2")); htmlText.append(email); htmlText.append(MessagesUtils.getMessage("mcv.msg.registerOk3")); htmlText.append(password); htmlText.append(MessagesUtils.getMessage("mcv.msg.registerOk4")); messageBodyPart.setContent(htmlText.toString(), "text/html; charset=UTF-8"); multipart.addBodyPart(messageBodyPart); System.out.println("sending registration email 2"); ... ...


Reply With Quote