短信发送方法
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
526 B

  1. package sms
  2. import (
  3. "testing"
  4. )
  5. func Test_SendByALiYun(t *testing.T) {
  6. accessKeyId := "LTAI5tCxxykQfnZtmYD8tm2x"
  7. accessKeySecret := "RgbY2Z9ciVc3ljXPr6OXw1ycn3rCIu"
  8. signName := "鄱阳湖生态科技城"
  9. phoneNumbers := "13790717280"
  10. templateCode := "SMS_224500006"
  11. params := make(map[string]string, 0)
  12. params["code"] = "666666"
  13. TemplateParam, _ := json.Marshal(params)
  14. ret, err := SendByALiYun(accessKeyId, accessKeySecret, phoneNumbers, signName, templateCode, string(TemplateParam))
  15. t.Log(ret)
  16. t.Log(err)
  17. }