您好,登錄后才能下訂單哦!
短信服務(wù) Go語言開發(fā)
采用的是阿里云-云通信-短信服務(wù),原來的阿里大于品牌已經(jīng)升級(jí)為“阿里云 · 云通信”。
用途
用戶注冊(cè)、找回密碼、用戶身份驗(yàn)證、驗(yàn)證碼登錄等等
使用說明
將其中的accessKeyId、accessKeySecret、phoneNumbers、signName、templateCode、templateParam替換成你的就可以直接使用了
package main
import (
"fmt"
"github.com/KenmyZhang/aliyun-communicate/app"
)
var (
gatewayUrl = "http://dysmsapi.aliyuncs.com/"
accessKeyId = "*******"
accessKeySecret = "*************"
phoneNumbers = "1354*********"
signName = "KenmyZhang"
templateCode = "SMS_82045083"
templateParam = "{\"code\":\"1234\"}"
)
func main() {
smsClient := app.NewSmsClient(gatewayUrl)
if result, err := smsClient.Execute(accessKeyId, accessKeySecret, phoneNumbers, signName, templateCode, templateParam); err != nil {
fmt.Println("error:%v", err.Error())
} else {
for key, value := range result {
fmt.Println("key:%v", key, " value:",value)
}
}
}
代碼已歸檔至:https://github.com/KenmyZhang/aliyun-communicate
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。