简体   繁体   English

发送自动短信

[英]Sending Automated SMS Messages

First, we use .net & sql server. 首先,我们使用.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 5551234444@vtext.com. 除了通过电子邮件网关发送短信之外,我从未做过这样的事情,比如5551234444@vtext.com。 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. 感谢您对解决此问题的任何意见。

Easiest way is to use an SMS gateway who provide an API. 最简单的方法是使用提供API的SMS网关。 Check out txtlocal 查看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. 如果您使用txtlocal这样的提供程序,您有两个选项 - 您可以在系统中构建计划,也可以使用批处理过程发送短信息以及您希望使用其API发送的时间。

I've used Clickatell in the past. 我过去曾经使用过Clickatell

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. 他们有一个RESTfull API,这意味着发送SMS就像使用消息和收件人的电话号码构建URL一样简单。

It's not free, obviously, but it's pretty darn cheap. 显然,这不是免费的,但它相当便宜。

There is a global email to SMS gateway, that you can use using the format 00+countrycode+mobilenumber@smssturen.com ie 00447811111111@smssturen.com, and put the message in the subject line. 有一个到SMS网关的全球电子邮件,您可以使用格式00+countrycode+mobilenumber@smssturen.com,即00447811111111@smssturen.com,并将邮件放在主题行中。

It's described in more detail here: http://sites.google.com/site/emailtosmsgateway/ 这里有更详细的描述: http//sites.google.com/site/emailtosmsgateway/

Dan. 担。

好吧,你要么必须使用短信网关,要么得到像这样的PCI / USB GSM调制解调器,它允许你直接从服务器发送短信。

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.) 话虽如此,IMO更容易使用网关(如已经建议的那样)。

https://www.twilio.com/sms/pricing/gb https://www.twilio.com/sms/pricing/gb

Twilio are quite cheap too.. similar to clickatell, they also have an API available but their prices appear to be cheaper at 0.04 USD ( 0.025 GBP at todays rate 22/06/2015 ) compared to clickatells cheapest rate of 0.034 GBP. Twilio也很便宜..类似于clickatell,它们也有API可用,但它们的价格似乎更便宜,为0.04美元(今天2015年6月22日为0.025英镑),而clickatells最便宜的价格为0.034英镑。

:) :)

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/ . 使用https://www.twilio.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM