# aliyun-sms
**Repository Path**: dialogs/aliyun-sms
## Basic Information
- **Project Name**: aliyun-sms
- **Description**: 阿里云 SMS 短信 & Spring Boot 集成
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 40
- **Created**: 2019-03-11
- **Last Updated**: 2021-02-18
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
[](https://opensource.org/licenses/Apache-2.0)

[](https://travis-ci.org/cn-src/aliyun-sms)
[](https://libraries.io/github/cn-src/aliyun-sms)
# aliyun-sms
阿里云 SMS 短信 Java SDK 封装
Github & Issues: [https://github.com/cn-src/aliyun-sms](https://github.com/cn-src/aliyun-sms)
# 使用
1. 添加依赖
``` xml
cn.javaer.aliyun
aliyun-sms
1.1.1
```
2. 样例
```java
SmsClient smsClient = new SmsClient(accessKeyId, accessKeySecret);
SmsTemplate smsTemplate = SmsTemplate.builder()
.signName(signName)
.templateCode(templateCode)
.addTemplateParam("code", "123456")
.phoneNumbers(phoneNumber)
.build();
smsClient.send(smsTemplate);
```
# spring boot 集成
1. 添加依赖
``` xml
cn.javaer.aliyun
aliyun-spring-boot-starter-sms
1.1.1
```
2. 配置
```
aliyun.sms.accessKeyId=
aliyun.sms.accessKeySecret=
aliyun.sms.signName=
aliyun.sms.templates.key1.templateCode=
```
3. 样例
```java
@Autowired
private SmsClient smsClient;
```
[官方文档:https://help.aliyun.com/document_detail/55284.html?spm=5176.8195934.1001856.3.5cd64183fNqodO](https://help.aliyun.com/document_detail/55284.html?spm=5176.8195934.1001856.3.5cd64183fNqodO)