const tencentcloud = require("tencentcloud-sdk-nodejs")
const smsClient = tencentcloud.sms.v20210111.Client
const client = new smsClient({
credential: {
secretId: process.env.secretId,
secretKey: process.env.secretKey,
},
region: "ap-guangzhou",
profile: {
signMethod: "HmacSHA256",
httpProfile: {
reqMethod: "POST",
reqTimeout: 30,
endpoint: "sms.tencentcloudapi.com"
},
},
})
const params = {
SmsSdkAppId: "1400787878",
SignName: "腾讯云",
TemplateId: "449739",
TemplateParamSet: ["1234"],
PhoneNumberSet: ["+8613711112222"],
SessionContext: "",
ExtendCode: "",
SenderId: "",
}
client.SendSms(params, function (err, response) {
if (err) {
console.log(err)
return
}
console.log(response)
})