2
votes

I am sending SMS through Twilio trial account using ASP.NET C#. I registered the numbers in my twilio account as I'm using trial account. Not getting any error but SMS is also not getting sent.But while checking SMS log in account it's showing Sent/Delivered. Any leads?

Please find my code snippet:

public void smsTwilio()
{
    const string accountSid = "accountSid";
    const string authToken = "authToken";
    TwilioClient.Init(accountSid, authToken);

    var to = new PhoneNumber("+91XXXXXXXXXX");
    var message = MessageResource.Create(
        to,
        from: new PhoneNumber("+1XXXXXXXXXX"),
        body: "This is the ship that made the Kessel Run in fourteen parsecs?");

    Console.WriteLine(message.Sid);
}
2
Show us your code, can't tell you what you are doing wrong if we don't know what you are doing at all. - Ron Beyer
Please edit your question and add it to the text there, it is nearly impossible to read in a comment. - Ron Beyer
@RonBeyer please find my updated post - Abhrajyoti Kanrar

2 Answers

2
votes

Twilio developer evangelist here.

With a Twilio Trial account, you should be able to text any numbers anywhere supported by Twilio. However, it's worth making sure you have the correct geo permissions enabled. You can do that by heading to this page and checking the "India" checkbox.

enter image description here

Next up, there are a few limitations when sending SMS messages to Indian mobile devices, which you can read more here. These are limitations established by carriers in the country as opposed to Twilio. The important ones that are likely to be affecting you now are:

  1. They cannot be sent to any phone number in India’s Do Not Call Registry
  2. They are only delivered between the hours of 9 A.M. and 9 P.M. local Indian time
  3. No more than one message every 20 minutes from the same Sender ID to the same destination number with the same message body.

Lastly, from within a phone number, you can click on "Messages Log" and see what's going on with the messages you're trying to send if they've been delivered correctly.

enter image description here

Hope this helps you.

0
votes

It seems you are trying to send a sms internationally, from a US(+1) number to an India number(+91) . this is blocked by default on trial twilio numbers.

You can try an initiate your twilio trial with an Indian number