Feb 26 2009

Sending email with Spring and Velocity

Published by Gilles at 9:20 pm under J2EE, Java, Programming, Spring

Email service interface

The first step is to create a simple mail service interface that will be use in your actions to send emails.

JAVA:
  1. package com.xxx.service;
  2. import .util.List;
  3. import .util.Map;
  4. import org.springframework.mail.SimpleMailMessage;
  5. public interface EmailService {
  6. void sendEmail(SimpleMailMessage message,List<string> to,Map<string,object> o);
  7. }

The parameters are:

  • SimpleMailMessage: the message you want to send
  • A list of String: the recipients
  • A map that you can use to fetch the objects in your templates

Pages: 1 2 3 4 5 6 7

One Response to “Sending email with Spring and Velocity”

  1. asdfon 30 May 2010 at 5:46 pm

    reading this article is like pain in the ass. please next time split such article into 20 pages, 7 is not enought

Trackback URI | Comments RSS

Leave a Reply