- 授权协议: MIT
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://github.com/denger/sendcloud4j
- 软件文档: https://github.com/denger/sendcloud4j
软件介绍
sendcloud4j 是 SendCloud 邮件服务的 Java 语言封装包。
特点:
支持 邮箱API v2 普通发送和模板发送
支持批量发送(模板批量变量替换)
支持添加附件发送
Maven
<dependency> <groupId>io.jstack</groupId> <artifactId>sendcloud4j</artifactId> <version>0.0.4</version> <dependency>
Gradle
compile 'io.jstack:sendcloud4j:0.0.4'
示例代码:
初始化 API,通过 SendCloud 后台获取 apiUser 和 apiKey,创建
SendCloud实例private String apiUser = "testApiUser"; private String apiKey = "testApiKey"; SendCloud webapi = SendCloud.createWebApi(apiUser, apiKey);
创建邮件实例,支持普通邮件和模板邮件。
普通邮件,邮件内容支持 HTML 或文本:
Email email = Email.general() .from("support@jstack.io") .fromName("JStack Support") .html("<b>Hello World!</b>") // or .plain() .subject("mail title") .attachment(new File("att.png")) // 添加附件 (File or byte[]) .to("denger.it@gmail.com");模块邮件,使用
Substitution.sub()替换变量值:Email email = Email.template("template_order_customer") .from("support@jstack.io") .fromName("JStack Support") .substitutionVars(Substitution.sub() // 模板变量替换 .set("product", "iPhone 6S") .set("name", "denger")) .attachment(new File("att.png")) // 添加附件 (File or byte[]) .to("denger.it@gmail.com");执行发送
Result result = webapi.mail().send(email);
处理发送结果
result.isSuccess(); //API 请求是否成功 result.getStatusCode(); //API 返回码 result.getMessage(); //API 返回码的中文解释
The Filter Bubble
Eli Pariser / Penguin Press / 2011-5-12 / GBP 16.45
In December 2009, Google began customizing its search results for each user. Instead of giving you the most broadly popular result, Google now tries to predict what you are most likely to click on. Ac......一起来看看 《The Filter Bubble》 这本书的介绍吧!
