使用自定义SenderID进行出站SMS Nexmo

时间:2017-02-06 04:50:02

标签: c# asp.net nexmo

如果我想使用自定义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"
  }
}

1 个答案:

答案 0 :(得分:0)

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

即可