jfinal-mailer一款支持线程池的异步邮件,可以使用freemarker作为模板的邮件插件...

https://github.com/Dreampie/jfinal-mailer    jfinal-mailer异步的邮件发送插件:

<dependency>
      <groupId>cn.dreampie</groupId>
      <artifactId>jfinal-mailer</artifactId>
      <version>${jfinal-mailer.version}</version>
 </dependency>

目前刚刚发布第一个版本0.1:

<jfinal-mailer.version>0.1</jfinal-mailer.version>

使用方法:

在jfinal config里configPlugin方法加入

    //emailer插件
    plugins.add(new MailerPlugin());

使用freemarker作为模板方法:

Mailer.sendHtml("测试", "<a href='www.dreampie.cn'>Dreampie</a>", "173956022@qq.com");

Mailer.sendHtml("Dreampie.cn-梦想派",new FreemarkerLoader("mails/signup_email.ftl").set("full_name", "先生/女士").set("safe_url", getAttr("_webRootPath") + "/tosignup?token=" + token.get("uuid")).getHtml(), regUser.getStr("email"));//set参数和至,getHtml获取模板编译的html内容,发送html内容

sendText(final String subject, final String body, final String... recipients) //发送文本
sendAttachment(final String subject, final String body, final EmailAttachment attachment, final String... recipients)//发送附件


https://github.com/Dreampie?tab=repositories 目录下有多款插件:

cn.dreampie.jfinal-shiro     https://github.com/Dreampie/jfinal-shiro    shiro插件

cn.dreampie.jfinal-shiro-freemarker   https://github.com/Dreampie/jfinal-shiro-freemarker    shiro插件实现的freemarker标签库

cn.dreampie.jfinal-web     https://github.com/Dreampie/jfinal-web   相关web插件,简洁model实现

cn.dreampie.jfinal-utils        https://github.com/Dreampie/jfinal-utils   部分jfinal工具

cn.dreampie.jfinal-tablebind        https://github.com/Dreampie/jfinal-tablebind   jfinal的table自动绑定插件,支持多数据源

cn.dreampie.jfinal-flyway      https://github.com/Dreampie/jfinal-flyway   数据库脚本升级插件,开发中升级应用时,使用脚本同步升级数据库或者回滚

cn.dreampie.jfinal-captcha      https://github.com/Dreampie/jfinal-captcha   基于jfinal render的超简单验证吗插件

cn.dreampie.jfinal-quartz       https://github.com/Dreampie/jfinal-quartz   基于jfinal 的quartz管理器

cn.dreampie.jfinal-sqlinxml      https://github.com/Dreampie/jfinal-sqlinxml   基于jfinal 的类似ibatis的sql语句管理方案

cn.dreampie.jfinal-lesscss       https://github.com/Dreampie/jfinal-lesscss   java实现的lesscsss实时编译插件,可以由于jfinal

cn.dreampie.jfinal-coffeescript     https://github.com/Dreampie/jfinal-coffeescript   java实现的coffeescript实时编译插件,可以由于jfinal 

cn.dreampie.jfinal-akka    https://github.com/Dreampie/jfinal-akka   java使用akka执行异步任务

cn.dreampie.jfinal-mailer       https://github.com/Dreampie/jfinal-mailer   使用akka发布邮件的jfinal插件

cn.dreampie.jfinal-slf4j     https://github.com/Dreampie/jfinal-slf4j   让jfinal使用slf4j的日志api

部分内容借鉴了网络资料


转载于:https://my.oschina.net/Dreampie/blog/312764

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值