volcengine / volc-sdk-golang

Apache License 2.0
103 stars 50 forks source link

SMS 发送短信返回200,但实际并没有接收到短信 #7

Closed ricew4ng closed 2 years ago

ricew4ng commented 2 years ago

SMS

status_code = 200,但手机实际并没有收到短信。

代码:

func TestVolcSMS(t *testing.T) {
    phone := "15xxxxxxxx"
    code := "23414"
    sms.DefaultInstance.Client.SetAccessKey(AccessKeyID)
    sms.DefaultInstance.Client.SetSecretKey(AccessKeySecret)
    cj, _ := json.Marshal(Code{Code: code})
    req := &sms.SmsRequest{
        SmsAccount:    "smsAccount",
        Sign:          "sign",
        TemplateID:    SmSTemplateID,
        TemplateParam: string(cj),
        PhoneNumbers:  phone,
        Tag:           "tag",
    }
    result, statusCode, err := sms.DefaultInstance.Send(req)
    t.Logf("[SMS] err: %v, send code(%s) to %s, result => %v, status_code => %v\n", err, code, phone, result, statusCode)
}

结果:

image