C#至少一次免费短信发送者



我正在构建我的C#应用程序,如果成功注册,该应用程序将通过其手机通知用户。这将向他们发送他们的帐户详细信息。我已经使用此代码成功地使用了Bulk Sms Clickatell在手机上发送了一条消息:

WebClient client = new WebClient();
baseURL = "http://api.clickatell.com/http/sendmsg?user=xxxxxx&password=xxxxxxx&api_id=xxxxxxxx&to='" + mobileNum + "'&text='" + msg + "'";
client.OpenRead(baseURL);

问题是我需要购买一些积分才能发送实际消息。我在手机上收到的那封我需要购买积分等。

您可以尝试Twilio。如果您想测试,它是免费的,但是在您必须付款之后。

他们有一个不错的API,带有C#支持。

// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        string AccountSid = "AC3094732a3c49700934481addd5ce1659";
        string AuthToken = "{{ auth_token }}";
        var twilio = new TwilioRestClient(AccountSid, AuthToken);
        var sms = twilio.SendSmsMessage("+15005550006", "+14108675309", "All in the game, yo", "");
        Console.WriteLine(sms.Sid);
    }
}

最新更新