当前位置:   article > 正文

阿里云短信快速入门_阿里云短信依赖

阿里云短信依赖
1.导入依赖
<!--阿里云短信依赖 -->
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-core</artifactId>
    <version>4.6.0</version>
</dependency>

<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
    <version>2.2.1</version>
</dependency>

2.创建类

package com.tm.utils;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile;
import com.google.gson.Gson;
import com.aliyuncs.dysmsapi.model.v20170525.*;


public class SendSms {

    public static void main(String[] args) {

        DefaultProfile profile = DefaultProfile.getProfile("cn-shanghai", "密钥", "密钥");
        /** use STS Token
        DefaultProfile p
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/283906
推荐阅读
相关标签
  

闽ICP备14008679号