Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Development of Go language for short message Service

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

SMS Go Language Development

Alibaba Cloud-Cloud Communication-SMS service is adopted. The original Alibaba brand has been upgraded to "Alibaba Cloud Communication."

use

User registration, password recovery, user authentication, Captcha login, etc.

instructions for use

Replace accessKeyId, accessKeySecret, phoneNumbers, signName, templateCode, templateParam with yours and you can use it directly.

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)

}

}

}

Code archived at: github.com/KenmyZhang/aliyun-communicate

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report