Sending Automated SMS Messages

前端 未结 7 1642
独厮守ぢ
独厮守ぢ 2021-02-09 15:20

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 li

相关标签:
7条回答
  • 2021-02-09 16:03

    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.

    0 讨论(0)
  • 2021-02-09 16:05

    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.

    0 讨论(0)
  • 2021-02-09 16:06

    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.)

    0 讨论(0)
  • 2021-02-09 16:06

    There is a global email to SMS gateway, that you can use using the format 00+countrycode+mobilenumber@smssturen.com i.e. 00447811111111@smssturen.com, and put the message in the subject line.

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

    Dan.

    0 讨论(0)
  • 2021-02-09 16:09

    :)

    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}.iws@iwspcs.net,{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.

    Update

    Use https://www.twilio.com/.

    0 讨论(0)
  • 2021-02-09 16:14

    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.

    0 讨论(0)
提交回复
热议问题