final EmailSender email, final MessageTemplate tpl) {
JavaMailSenderImpl sender = new JavaMailSenderImpl();
sender.setHost(email.getHost());
sender.setUsername(email.getUsername());
sender.setPassword(email.getPassword());
sender.send(new MimeMessagePreparator() {
public void prepare(MimeMessage mimeMessage)
throws MessagingException, UnsupportedEncodingException {
MimeMessageHelper msg = new MimeMessageHelper(mimeMessage,
false, email.getEncoding());
msg.setSubject(tpl.getForgotPasswordSubject());