C#中的短信库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1195624/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 10:33:52  来源:igfitidea点击:

SMS Library in C#

c#smsgateway

提问by Prasad

I need to develop an application that sends SMS to the users that are interested to get the updates about the website.

我需要开发一个应用程序,向有兴趣获取网站更新的用户发送 SMS。

I am looking for Library in C# which is useful to integrate with my application. The Library can be GSM Modem dependent or free service which i can make use of it.

我正在寻找 C# 中的库,它对与我的应用程序集成很有用。图书馆可以依赖 GSM 调制解调器或免费服务,我可以使用它。

Please can anyone suggest the library or SMS gateway which can be integrated with C# application.

请任何人都可以建议可以与 C# 应用程序集成的库或 SMS 网关。

回答by NickAldwin

Have you tried using the System.Net.Mail functions to send mail to the email corresponding to the phone number?

您是否尝试过使用 System.Net.Mail 功能向电话号码对应的邮箱发送邮件?

e.g. [email protected]

例如 [email protected]

(List of email domains here: http://www.tech-recipes.com/rx/939/sms_email_cingular_nextel_sprint_tmobile_verizon_virgin/)

(此处的电子邮件域列表:http: //www.tech-recipes.com/rx/939/sms_email_cingular_nextel_sprint_tmobile_verizon_virgin/

EDIT: even bigger list here http://en.wikipedia.org/wiki/SMS_gateway

编辑:这里有更大的列表 http://en.wikipedia.org/wiki/SMS_gateway

EDIT 2: Bigger list here, Wikipedia link no longer has as much information http://www.ukrainecalling.com/email-to-text.aspx

编辑 2:这里有更大的列表,维基百科链接不再有尽可能多的信息 http://www.ukrainecalling.com/email-to-text.aspx

回答by cwap

Judging from your comments, I'd say leasing a SMS gateway is the easier option. I don't have any experience with USA gateway providers, but from the ones I've worked with, I can say that they are all fairly simple. Most of good ones has .Net APIs ready for you, so you essentially just call SendSMS(string phonenumber, string message) on them. If they don't have any .Net APIs they ussually have webservices ready for you, which is a 1-click integration into Visual Studio.

从您的评论来看,我认为租用 SMS 网关是更简单的选择。我对美国网关提供商没有任何经验,但从我合作过的那些提供商来看,我可以说它们都相当简单。大多数好的应用程序都为您准备好了 .Net API,因此您基本上只需在它们上调用 SendSMS(string phonenumber, string message)。如果他们没有任何 .Net API,他们通常会为您准备好网络服务,这是一键集成到 Visual Studio 中。

A simple google search came up with quite a few providers :)

一个简单的谷歌搜索提出了很多提供商:)

http://www.google.dk/search?hl=da&q=sms+gateway+usa&meta=&aq=f&oq=

http://www.google.dk/search?hl=da&q=sms+gateway+usa&meta=&aq=f&oq=

回答by Akash Kava

  1. Sending SMS is no longer free, ofcourse all ISPs dont want their customers to get spammed heavily if it would be free !!

  2. If you want to send sms from your website within your .net code, then you can try clickatell.com, because anyway on webserver you cant really connect a cellphone unless you can get a chance to get into datacenter and setup your own hardware.

  1. 发送 SMS 不再是免费的,当然,如果免费,所有 ISP 都不希望他们的客户收到大量垃圾邮件!!

  2. 如果你想在你的.net 代码中从你的网站发送短信,那么你可以尝试 clickatell.com,因为无论如何在网络服务器上你不能真正连接手机,除非你有机会进入数据中心并设置你自己的硬件。

回答by Akash Kava

If you want to send a lot of SMS messages then a gateway and a bundle deal is by far the cheapest way to go - you generally just send an email to the gateway with the users number in the subject line. If you want something more flexible (but not as cheap) then try Email to SMS

如果您想发送大量 SMS 消息,那么网关和捆绑交易是迄今为止最便宜的方式 - 您通常只需向网关发送一封电子邮件,主题行中包含用户编号。如果您想要更灵活的东西(但不那么便宜),请尝试通过 电子邮件发送短信

回答by Suriyan Suresh

Use Gammu, this is a console application you can use it in any type of application, launch the application capture the output then process it, already i had done in my c# project. Gammu has capablity to connecting to any type of gsm modem

使用Gammu,这是一个控制台应用程序,您可以在任何类型的应用程序中使用它,启动应用程序捕获输出然后处理它,我已经在我的 c# 项目中完成了。Gammu 能够连接到任何类型的 gsm 调制解调器

回答by Illia Ratkevych

I'm currently use "mCore .Net Library 1.2" for this purposes. It's simple enough, but unfortunately not completely bug-free.

为此,我目前使用“mCore .Net Library 1.2”。这很简单,但不幸的是并非完全没有错误。

回答by iSMS Malaysia

Our team member has just posted a tutorial on how to send sms using c#.

我们的团队成员刚刚发布了一个关于如何使用 c# 发送短信的教程。

// Create a new 'Uri' object with the specified string.
Uri myUri = new Uri("http://isms.com.my/isms_send.php?un=" + username.Text + "&pwd=" + mypassword.Text + "&dstno=" + phonebox.Text + "&msg=" + msgbox.Text + "&type=1&sendid=60198899001");

// Create a new request to the above mentioned URL.
WebRequest myWebRequest = WebRequest.Create(myUri);

// Assign the response object of 'WebRequest' to a 'WebResponse' variable.
WebResponse myWebResponse = myWebRequest.GetResponse();
StreamReader reader = new StreamReader(myWebResponse.GetResponseStream());

string s_ResponseString = reader.ReadToEnd();

So if you are interested, just head over to http://www.isms.com.my/how-to-send-sms-c-sharp.phpand you can also download the demo file for testing purposes. :)

因此,如果您有兴趣,只需前往http://www.isms.com.my/how-to-send-sms-c-sharp.php,您也可以下载演示文件以进行测试。:)

Click HEREto download iSMS Demo Project

单击此处下载 iSMS 演示项目