Skip to content

qinxin0720/alisms-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

阿里云短信平台SDK Go语言实现

DEMO

package main

import (
	"github.com/qinxin0720/alisms-go/SmsClient"
	"net/http"
	"log"
)

const (
	accessKeyId     = "yourAccessKeyId"
	secretAccessKey = "yourAccessKeySecret"
)

func main() {
	sc, err := SmsClient.NewSMSClient(accessKeyId, secretAccessKey)
	if err != nil {
		return
	}
	statusCode, _, _ := sc.SendSMS(SmsClient.Params{"1500000000", "阿里云短信", "SMS_000000", `{"code":"12345"}`})
	if statusCode == http.StatusOK {
		log.Println("发送成功")
	} else {
		log.Println("发送失败")
	}
}

About

阿里云短信平台SDK Go语言实现

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages