This is a couple years old, but perhaps still works:
Just use javax.mail.* to send the mail. There are lots of examples out there on how to do that. This below just populates a template with a string and returns the template as a string that you can then send via email.


  public static final String NOTICE = notice_email.vm";
  protected String createEmailFromTemplate(String something)
  {
    VelocityContext context = new VelocityContext();
    context.put("contents",something);
    Template template = null;
    StringWriter sw = new StringWriter();
    try {
      template = Velocity.getTemplate(NOTICE);
      template.merge(context,sw);
     }
    catch (Exception e) {
      do_something_desperate(e.toString()); // ;-)
    }
    StringBuffer sb = sw.getBuffer();
    return sb.toString();
   }

Ken A

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to