go短信接口代码

180it 2021-06-04 PM 1841℃ 0条
package main
import (
    "net/http"
    "io/ioutil"
    "net/url"
    "fmt"
 )
func main(){
    //账号
    account      := "***************"
    //密码
    pswd      := "***************"
     // 修改为您要发送的手机号码,多个号码用逗号隔开
    mobile      := "***************"
    //短信内容
    contentyzm :="【秒赛科技】您的验证码是:1234"
      
      
    // 发送url,请咨询客服
    url_send    := "xxxxxxxxxxxxxxxxxxx";
      
      
    data_send   := url.Values{"account": {account}, "pswd": {pswd},"mobile": {mobile},"msg":{msg},"needstatus":"true"}
      
    httpsPostForm(url_send,data_send)
      
}
func httpsPostForm(url string,data url.Values) {
    resp, err := http.PostForm(url,data)
    if err != nil {
        // handle error
    }
    defer resp.Body.Close()
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        // handle error
    }
    fmt.Println(string(body))
}
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

go短信接口代码