Domain Information: [ドメイン情報]
a. [ドメイン名] EXAMPLE.OR.JP
e. [そしきめい]
f. [組織名] はなこ
g. [Organization] HANAKO
k. [組織種別] 花子法人
l. [Organization Type] region organization
m. [登録担当者] MS***JP
n. [技術連絡担当者] YE****JP
p. [ネームサーバ] dns01.muumuu-domain.com
p. [ネームサーバ] dns02.muumuu-domain.com
s. [署名鍵]
[状態] Connected (2021/07/31)
[登録年月日] 1997/07/14
[接続年月日] 1998/06/29
[最終更新] 2020/12/23 03:43:06 (JST)
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program
{
static void Main(string[] args)
{
// Find your Account Sid and Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
string accountSid = Environment.GetEnvironmentVariable("SIDをここに");
string authToken = Environment.GetEnvironmentVariable("AUTHトークンをここに");
TwilioClient.Init(accountSid, authToken);
var message = MessageResource.Create(
body: "This is the ship that made the Kessel Run in fourteen parsecs?",
from: new Twilio.Types.PhoneNumber("+15017122661"),
to: new Twilio.Types.PhoneNumber("+15558675310")
);
Console.WriteLine(message.Sid);
}
}
この通りに実装すると、[Username can not be null]というエラーメッセージが表示されてSMS送信されません。
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
namespace TwilioSMS
{
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("ここにSID", "ここにAuthトークン");
var message = MessageResource.Create(
body: "This is the ship that made the Kessel Run in fourteen parsecs?",
from: new Twilio.Types.PhoneNumber("取得した電話番号"),
to: new Twilio.Types.PhoneNumber("SMSを送信する電話番号")
);
Console.WriteLine(message.Sid);
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
// Find your Account Sid and Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
TwilioClient.Init("SIDを設定", "AUTHトークンを設定");
var message = MessageResource.Create(
body: "日本語送信のテストです",
from: new Twilio.Types.PhoneNumber("取得した電話番号を設定"),
to: new Twilio.Types.PhoneNumber("送信先の携帯電話番号を設定")
);
}