/**
* 详细内容参考阿里云短信官方文档
*
* @param mobile 手机号
* @param templateCode 阿里云官网上的模板名字
* @param param 自定义的参数,内容里包括发送给用户的验证码和信息主体
*/
public void send(String mobile, String templateCode, Map<String, Object> param) {
//创建远程连接客户端对象,填写访问信息
DefaultProfile profile = DefaultProfile.getProfile(
SmsProperties.REGION_Id,
SmsProperties.KEY_ID,
SmsProperties.KEY_SECRET);
IAcsClient client = new DefaultAcsClient(profile);
//创建远程连接的请求参数
CommonRequest request = new CommonRequest();
request.setSysMethod(MethodType.POST);
request.setSysDomain("dysmsapi.aliyuncs.com");</
阿里云短信Demo
最新推荐文章于 2024-06-08 17:04:18 发布
本文将指导您如何使用Java SDK快速接入阿里云短信服务,实现短信发送功能。首先,您需要在阿里云控制台创建短信签名和模板,然后下载SDK,配置AccessKey,最后编写代码调用API发送短信。
摘要由CSDN通过智能技术生成