views:

1285

answers:

6

First, we use .net & sql server.

I have a client that is interested in a system that will send SMS messages at scheduled times.

I have never done anything like this except for sending an sms through an email gateway, like [email protected]. But, I don't think that is an option for this as, our database will store the phone number and ignore the provider.

Thanks for any input on tackling this problem.

+3  A: 

Easiest way is to use an SMS gateway who provide an API. Check out txtlocal

If you use a provider such as txtlocal you have 2 options - you can either build the scheduling into your system, or you could have a batch process which sends the sms info and the time that you want it to be sent using their API.

Macros
+1  A: 

Well, you either have to use an SMS gateway as you mention, or get a PCI/USB GSM modem like this one which allows you to send texts straight from the server.

tomlog
Is the modem a free solution once installed? Is it easy to setup and use? Could you give an example of some code that might use the modem? Thanks.
Ronnie Overby
It would, of course, require a commercial texting plan tied to the SIM used in the modem.
Peter J
+1  A: 

I've used Clickatell in the past.

They have a RESTfull API, which means sending as SMS is as easy as constructing a URL with the message and recipient's phone number.

It's not free, obviously, but it's pretty darn cheap.

Assaf Lavie
+1  A: 

Have a look at this link. It gives some great info. Having said that, IMO it is easier to use a gateway (as has already been suggested.)

Khadaji
+1  A: 

:)

Here's something that I whipped up that seems to be working well:

    public static void SendSMS(string from, string number, string subject, string message, SmtpClient smtp)
    {
        long.Parse(number);

        List<string> domains = new List<string>(
            "{N}[email protected],{N}@airtelap.com,{N}@airtelkk.com,{N}@alertas.personal.com.ar,{N}@bplmobile.com,{N}@cingularme.com,{N}@clarotorpedo.com.br,{N}@comcel.com.co,{N}@cwemail.com,{N}@email.uscc.net,{N}@emtelworld.net,{N}@fido.ca,{N}@gocbw.com,{N}@gsm.sunrise.ch,{N}@ideasclaro-ca.com,{N}@iwirelesshometext.com,{N}@message.alltel.com,{N}@messaging.nextel.com,{N}@messaging.sprintpcs.com,{N}@mmode.com,{N}@mms.att.net,{N}@mms.bouyguestelecom.fr,{N}@mms.mymeteor.ie,{N}@mobile.celloneusa.com,{N}@mobiletxt.ca,{N}@movistar.com.co,{N}@msg.acsalaska.com,{N}@msg.gci.net,{N}@msg.globalstarusa.com,{N}@msg.iridium.com,{N}@msg.telus.com,{N}@msgnextel.com.mx,{N}@myboostmobile.com,{N}@myhelio.com,{N}@mymetropcs.com,{N}@page.att.net,{N}@page.nextel.com,{N}@pcs.rogers.com,{N}@qwestmp.com,{N}@sms.co.za,{N}@sms.ctimovil.com.ar,{N}@sms.mobitel.lk,{N}@sms.mycricket.com,{N}@sms.sasktel.com,{N}@sms.tigo.com.co,{N}@sms.t-mobile.at,{N}@text.aql.com,{N}@text.mtsmobility.com,{N}@tmomail.net,{N}@tms.suncom.com,{N}@torpedoemail.com.br,{N}@txt.att.net,{N}@txt.bell.ca,{N}@txt.bellmobility.ca,{N}@utext.com,{N}@vmobile.ca,{N}@vmobl.com,{N}@voda.co.za,{N}@vtext.com,+48{N}@text.plusgsm.pl,297+{N}@mas.aw,977{N}@sms.spicenepal.com,{N}@orange.pl,TwoWay.11{N}@nextel.net.ar,{N}@mmst5.tracfone.com"
            .Replace("{N}", number).Split(','));

        MailMessage mail = new MailMessage();
        mail.From = new MailAddress(from);
        mail.Subject = subject;
        mail.Body = message;
        domains.ForEach(d => mail.Bcc.Add(d)); 

        smtp.Send(mail);
    }

Domains were obtained from here.

Ronnie Overby
Unfortunately, the vast majority of emails you send with this will fail - which means that it won't take very long before the providers block you.
Aric TenEyck
Maybe. This isn't something I would do for a client. It was for fun.
Ronnie Overby
Why would someone downvote this?
Ronnie Overby
+1  A: 

Hi,

There is a global email to SMS gateway, that you can use using the format [email protected] i.e. [email protected], and put the message in the subject line.

It's described in more detail here: http://sites.google.com/site/emailtosmsgateway/

Dan.