Iterator i = receivers.iterator();
VelocityTool velTool= new VelocityTool(context);
while (i.hasNext())
{
Distributor dist = (Distributor) i.next();
String sEmailAddress=dist.getEmail();
if (sEmailAddress.length()>1){
VelocityHtmlEmail ve = new VelocityHtmlEmail(data);
ve.setCharset("UTF-8");
ve.addTo( sEmailAddress, "");
ve.setFrom(TurbineResources.getString("mail.smtp.from"), TurbineResources.getString("mail.smtp.from.name"));
ve.setSubject(emailEntry.getSubject());
context.put("name", dist.getDistributorName1());
context.put("display", dist.getDistributorDisplay());
context.put("dear", dist.getDear());
context.put("email", dist.getEmail());
context.put("custom1", dist.getCustom1());
context.put("custom2", dist.getCustom2());
context.put("custom3", dist.getCustom3());
context.put("custom4", dist.getCustom4());
context.put("custom5", dist.getCustom5());
context.put("custom6", dist.getCustom6());
context.put("emailbody", velTool.evaluate(emailEntry.getBody()));
ve.setTextTemplate("screens/SendEmail.vm");
ve.send();
}
}