1

如果我想使用自定义 SenderID 是否需要添加更多 applicationsetting.json 或代码?

假设我已经购买了 SenderID

这是我的代码:

string PhoneNo = "081375840392";
string SenderID = "CUSTOM";
var results = SMS.Send(new SMS.SMSRequest
{
       from = SenderID,
       to = PhoneNo,
       text = "Test Sms"
});

这是我的 appsettings.json

{
  "appSettings": {
    "Nexmo.UserAgent": "myApp/1.0",
    "Nexmo.Url.Rest": "https://rest.nexmo.com",
    "Nexmo.Url.Api": "https://api.nexmo.com",
    "Nexmo.api_key": "369b4188",
    "Nexmo.api_secret": "0d1479g48e641c89",

    "Nexmo.Application.Id": "ffffffff-ffff-ffff-ffff-ffffffffffff",
    "Nexmo.Application.Key": "c:\\path\\to\\your\\application\\private.key"
  }
}
4

1 回答 1

0

无需添加更多 appsettings.json 只需更改 from 参数即可

于 2017-02-06T08:48:15.193 回答