send new email from a custom filter

51 views
Skip to first unread message

Данил Ш

unread,
Mar 2, 2016, 5:04:35 PM3/2/16
to Mireka mail server and SMTP proxy
Hello! I've developed a custom filter which creates a periodic task at startup.
At the task i need to send a mail. Tell me how this can be done from the Runnable Thread. Please.


public class StoreDigestPerUserFilter extends StatelessFilterType {

@PostConstruct
public void addToManage(){
// -- add shedule
scheduler.scheduleAtFixedRate(new DigestRunnable(), 1, 1, TimeUnit.MINUTES);
}

/**
* Close connection pool
*/
@PreDestroy
public void close(){
log.info("StoreDigestPerUserFilter scheduler.shutdownNow()");
scheduler.shutdownNow();
}



public class DigestRunnable implements Runnable {
private final Logger log = LoggerFactory
.getLogger(DigestRunnable.class);

public void run() {
log.info(" DigestRunnable task run at " + new Date());
//TODO SendMail.send(map);
log.info(" DigestRunnable task finished at " + new Date());
}
}

HONTVÁRI Levente

unread,
Mar 2, 2016, 5:57:17 PM3/2/16
to mir...@googlegroups.com
Use javamail, just like in a regular client application.
--

---
You received this message because you are subscribed to the Google Groups "Mireka mail server and SMTP proxy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mireka+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages