title: Spring mvc send mail as non-blocking
body: <p>I am developing an application and that application sends mail in some cases. For example;</p>
  
  <p>When user updates his email, an activation mail sent to user in order to validate new email address. Here is a piece of code;</p>
  
  <pre><code>............
  if (!user.getEmail().equals(email)) {
              user.setEmailTemp(email);
              Map map = new HashMap();
              map.put("name", user.getName() + " " + user.getSurname());
              map.put("url", "http://activationLink");
              mailService.sendMail(map, "email-activation");
          }
  return view;
  </code></pre>
  
  <p>My problem is response time gets longer because of email sending. Is there any way to send email like non-blocking way? For example, Mail sending executes at background and code running continues</p>
  
  <p>Thanks in advance</p>