Exemplo n.º 1
0
  @RequestMapping("/sendQuote.htm")
  public void sendQuote(
      @RequestParam String name, @RequestParam String email, @RequestParam String message) {
    SimpleMailMessage mail = new SimpleMailMessage();
    templateMessage.copyTo(mail);
    mail.setTo("*****@*****.**");
    mail.setSubject("Quote from Qash site [" + name + "]");
    mail.setText("From: " + name + "(" + email + ")\n\n" + mail);

    mailSender.send(mail);

    // return "redirect:/index.htm";
  }
Exemplo n.º 2
0
 /**
  * @param simpleMailMessage
  * @return
  */
 public MimeMessage toMimeMessage(SimpleMailMessage simpleMailMessage) {
   MimeMessage mimeMessage = createMimeMessage();
   MimeMailMessage mmm = new MimeMailMessage(mimeMessage);
   simpleMailMessage.copyTo(mmm);
   return mmm.getMimeMessage();
 }