- 授权协议: 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 返回码的中文解释
网络多人游戏架构与编程
格雷泽 (Joshua Glazer)、马达夫 (Sanjay Madhav) / 王晓慧、张国鑫 / 人民邮电出版社 / 2017-10-1 / CNY 109.00
本书是一本深入探讨关于网络多人游戏编程的图书。 全书分为13章,从网络游戏的基本概念、互联网、伯克利套接字、对象序列化、对象复制、网络拓扑和游戏案例、延迟、抖动和可靠性、改进的延迟处理、可扩展性、安全性、真实世界的引擎、玩家服务、云托管专用服务器等方面深入介绍了网络多人游戏开发的知识,既全面又详尽地剖析了众多核心概念。 本书的多数示例基于C++编写,适合对C++有一定了解的读者阅读。本......一起来看看 《网络多人游戏架构与编程》 这本书的介绍吧!
