@@ -0,0 +1,876 @@
+package com.example.service.email.decorator;%0A%0Aimport org.springframework.mail.MailException;%0Aimport org.springframework.mail.javamail.JavaMailSender;%0Aimport org.springframework.scheduling.annotation.Async;%0A%0Aimport javax.mail.internet.MimeMessage;%0A%0A/**%0A * Async mail sender. In background %7B@link Async @Async%7D annotation is used.%0A * For correct functionality %7B@link org.springframework.scheduling.annotation.EnableAsync @EnableAsync%7D%0A * has to be used somewhere in your application.%0A *%0A * @author Michal Vlcek %3Cmychalvlcek@gmail.com%3E%0A * @see Async%0A * @see org.springframework.scheduling.annotation.EnableAsync%0A */%0Apublic class AsyncMailSender extends AbstractMailSenderDecorator %7B%0A%0A%09public AsyncMailSender(JavaMailSender mailSender) %7B%0A%09%09super(mailSender);%0A%09%7D%0A%0A%09@Async%0A%09@Override%0A%09public void send(MimeMessage mimeMessage) throws MailException %7B%0A%09%09super.send(mimeMessage);%0A%09%7D%0A%7D%0A

add async mail sender decorator