user5067119
user5067119

Reputation: 155

sending free confirm SMS messages using ASP.NET

I'm working with ASP.NET web application and i want to confirm user account after registration using SMS messages . the only way i have found is to use twilio and i need to buy a number ! which will appear in the "FROM " field as a number not a name in the SMS! the twilio code i have found is this :

 // Find your Account Sid and Auth Token at twilio.com/user/account 
        string AccountSid = "..";
        string AuthToken = "[AuthToken]";
        var twilio = new TwilioRestClient(AccountSid, AuthToken);

        var message = twilio.SendMessage("[From]", "[To]", null, null, null);
        Console.WriteLine(message.Sid);

my question: is there any way to send a confirm SMS for free ? and can i chose the name also in "FROM " field in the messages? please any help ?

Upvotes: 0

Views: 1939

Answers (3)

philnash
philnash

Reputation: 73055

Twilio developer evangelist here.

There's some good suggestions in these answers for free messages, I'd just like to answer from the Twilio perspective too.

You can send SMS messages from Twilio and provide your own sender ID that is not a number. This works in 145 countries listed here. You would send the message in exactly the same way, except you would substitute the sender ID that you want for the From number in your example.

It will, however, cost you to send an SMS (as it costs us). Also, if you need to send SMS messages to one of the countries that doesn't support an alphanumeric sender ID, like the US, you will want to fallback to using a number to send the message.

Let me know if this helps at all.

Upvotes: 1

sa289
sa289

Reputation: 700

You can send text messages for free using the carrier's email text message address (check out http://www.emailtextmessages.com/ for the formats to use). It's not as good because it requires users to select their carrier, and carriers can change over time with number porting, but in your case since it's just for initial confirmation the carrier changing isn't a concern. If I recall correctly, the FROM in this case will show as the email address you send the text from.

An example would be you could text a Verizon customer using [email protected], assuming the phone number is 123-456-7890.

In order to get a free solution, you might have to make some sacrifice such as going this route.

Upvotes: 1

Dan Field
Dan Field

Reputation: 21661

Most carriers allow sending SMS messages via SMTP. There's a decent list here: http://martinfitzpatrick.name/list-of-email-to-sms-gateways/, and Google is your friend here.

You could ask the user for their carrier (in a drop down list) as well as their phone number, and then use SmtpClient to send an email. For example, if you wanted to send a SMS message to 1234 on Verizon, the send part might look something like this:

SmptClient smpt = new SmptClient(...);
...
if (carrier = "Verizon")
{
    smpt.Send("[email protected]", phoneNumber + "@vtext.com", "Welcome to MySite.com!", "Your account is registered.");
}

Obviously you'll need to have a valid Smtp configuration, and you'd probably want to have a more elegant way of parsing carriers, but that's the general idea.

This is not entirely free though - you do need an email server. You may also run into trouble with carriers if you send too many messages or too many users complain you're spamming them (something I imagine a paid service would handle for you).

Upvotes: 0

Related Questions