How to send sms - c#

I want to send an sms to a mobile phone through my C#, C++ code. Can any body help me. I dont want any mobile, or any external device attached to my computer. I am just having my laptop, or desktop PC and in that i want to write a C++ or C# application which can send an sms to a mobile phone.

Clickatell is a popular SMS gateway, which covers 819 networks in over 220 countries.
The API offers a choice of connection options via: HTTP/S, SMPP, SMTP, FTP, XML, SOAP and COM. You can simply choose any suitable connection method that you feel confortable using in C# or C++.
To give a few examples, the HTTP method would be as simple as requesting the following URI from your application:
http://api.clickatell.com/http/sendmsg?to=NUMBER&msg=Message+Body+Here
The SMTP method would consist in sending a plain-text email to sms#messaging.clickatell.com, with a body as in the following example:
user: xxxxx
password: xxxxx
api_id: xxxxx
to: NUMBER
text: Message Body Here
The other methods are similarly easy to interface with, in my opinion. You can check out the full details from the Clickatell API Guide.

There are a couple options out there. You could use a gateway like Twilio, Clickatell or the many others. These cost money but are more reliable than other methods. I wrote a C#/.NET library for Twilio that makes it super easy to use.
Alternately you could ask each user for their carrier, then send an email to their phone's email address. This is less reliable and requires you to know what carrier they use and if they change carriers, they have to remember to tell you.

Related

Make a mobile number send an SMS

i am thinking if it is possible to have a (remote) cell/mobile number send an SMS via C#?
for example, my cell number is +00 000 000 0000 and i want it to send a message to 0000 and say "Hello There", is there such technology that can do as such? This is different from using an SMS Gateway API which uses a specific number and send to 0000. I want my own cell number to send that message without touching my phone, is it possible via any AT Commands, or are there any (free) API that can help me with this?
Thanks.
If you are trying to get your PC to make your phone send an SMS message, you would have to build two pieces of software:
You would have to write a mobile app native to the phone's operating system that listens to some kind of push notification service to know to when to send a message. Depending on the phone OS, it may or may not be possible to actually send an SMS without first rooting the phone.
You would then need to write code on your PC to send a push notification that your phone app would receive, respond to, and send the SMS message.
If you are asking can you write mobile app software that can cause the phone it is running on to send an SMS, well I would refer you to the SDK of the phone OS you are targeting for that information.
Try Twilio: https://www.twilio.com/.
I'm using it for most of my projects.
You can try for free for 30 days. After the trial is over, you have to upgrade your account with at least 20.00 US$.
It supports plenty of programming languages, including .Net, Java, Python, etc.

Is there any way to send email with attachment in windows phone

Its really frustating that EmailComposeTask doesn't have any way to send attachments. I googled this and found MailMessage dll. I don't know whether it is secure or not because user gonna send his password.
Now I am thinking tot build my own service, send data from phone to service, and service will use smtp to send email with attachment.
Now I want to ask, Am I right? What kind of service I use?
I dont know about security concerns of MailMesssage.dll.
However, if you wish to send transactional EMails, then there are few services available. In such a case, you will not be required to create your own service. The popular one's are:
Sendgrid
Mandrill by MailChimp
MailGun by Rackspace
All services provide free tier and may be helpful, if you need to send, less EMails. Moreover, besides SMTP, these services provide Web APIs, so you can send mails using REST interface.

How do I convert text-to-call?

Am building an app for WP7 Mango version. The requirement is that when ever a message is sent from that app to a predefined set of contacts, in case the number to which the message is sent is not capable of receiving messages, then, a call should be made to such numbers and the text message (intended to be sent) should be read out to on the call to the call-receiver.
I have a huge doubt that this is achievable on WP7. Am I wrong in thinking so? Is there any way that this can be achieved? If yes, how?
Well...
There is a launcher which allows an app to send SMS, but it requires user interaction, and the user can change the SMS before sending. So you have no way to know exactly which SMS was sent.
There's no API on the phone to check whether a phone number can receive SMS or not (but maybe you can figure that out yourself using the phone number prefix or something)
There's no way to programmaticaly dial a number
There's no way to play a sound to the call-receiver. Arguably the user could turn on the phone's speaker while the app plays the sound out loud
There's no way to programmaticaly tell when the call-receiver has answered the phone call. So the user would have to manually push a button in the app when the call-receiver answers
In conclusion, while it might somehow be possible, it would require so much user interaction that the app would be pretty much pointless ;)
You could achieve these requirements using an SMS and IVR service in the cloud, such as SMSIfied and Prophecy, instead of attempting to do it directly from WP7.
SMSIfied lets you send and receive text message through a simple to use REST API. You can also get the results of sending the text message in a callback. Here is a blog post "Sending SMS messages with C# and SMSified".
For phone number that will not accept SMS you can use Prophecy to dial the number and play the message using Text-To-Speech (TTS). Prophecy is programmed using the open W3C standards Call Control XML (CCXML) and VoiceXML. You use CCXML to perform the outbound dialing and when the user or answering machine answers you pass control to VoiceXML application that handles the TTS. The Prophecy IVR has excellent call progress analysis which makes it easier to get the whole message on the answering machine/voice mail. Have you ever gotten those chopped messages from an automated system? The Voxeo documentation on CCXML has good coverage on how to perform outbound dialing in Chapter F. There is a good open source project called VoiceModel that makes it easier to develop VoiceXML applications using ASP.NET MVC 4.
To initiate this outbound dialing request from WP7 would just require an HTTP request that passes the parameters like the number to dial and the CCXML application to run in the query string. The actual CCXML and VoiceXML application would be hosted as web applications.

How to do interactive SMS in .NET?

I want to write an app that sends an SMS to users, and when the recipients texts back, I receive that response, including the originating phone number, and my program can react to that response.
I've googled "Interactive SMS" but didn't find anything that was clearly a fit. Has anyone else done this, got any recommendations for a paid service that provides this kind of functionality?
Alternatively, do you have any other recommendations for how to build this service into my app, which will probably be written in C#?
Find an SMS service provider that gives you an API you can use (e.g. an HTTP API). Then read their documentation.
You need to learn about SMPP (short message peer to peer) protocol. Is the protocol usually used to communicate with carrier's SMSC (Short Message Service Center). Here's a blog entry summarizing the actual status of some C# SMPP libraries. If you don't want to use an existing .NET library, you can always write your own. SMPP is not a very complex protocol after all.
An alternative might be attach your application to a cell phone, and if that cell phone provides you with an API, use it to send and receive texts. The problem here is that it won't scale if your application expects to send and receive hundreds of thousands of text messages per day.
Yet another alternative will be to use a CARRIER AGGREGATOR company that provides you with an API for your application. There are some out there, but I don't know if they will be able to offer you a short code and the possibility to receive texts in your application. Depending on the market you are targeting, you should do a little bit of research on how other VAS companies do it over there.
You can use the TextMarks API for this. It's REST-based and super simple to use. So simple that Harvard uses it to teach new students how to use APIs. Docs here.
Messages routed to you from a user are called MO messages (Mobile Originated) and most 3rd party SMS gateways implement simple api's whereby they will simply HTTP post you incoming messages (including the originators msisdn and home network).
For example http://www.clickatell.com/products/two_way.php
Search the site for SMS Gateways for others.
Check SMS Studio - guys have done a lot on that subject and maybe you can use of-the-shelve software or customize it a little to suit your needs.
If not, at least you can find some good keywords for googling.
Anyway, you will have a choice - either go with SMS gateway, or for low volume SMS traffic, you can go with GSM Modem and handle it manually, though it's not recommended.

How to develop my own sms Gateway?

I intend to develop an SMS gateway in c#, but i am doubtful about it's feasibility, because my initial research had shown that an SMS gateway had to cover for protocol differences.
So what exactly a gateway had to do, further if i use SMPP, so is it possible to send/receive SMS to/from any number in the world by simply using SMPP ?
A "true" SMS gateway will need to generate an SMPP request in the the correct format (yes there are several types like CIMD & EMI) and dispatch it to the mobile networks SMSMC for sending.
You would need a direct connection to, and contract with the network(s) you use on the back end. The countries you would be able to send to will depend on the what the network provider supports/allows.
Creating one is difficult & expensive, why not use an SMS aggregator who have already done all the hard work, for example http://www.clickatell.com/.
I don't know anything about creating a gateway but I'm fairly sure that the answer to so is it possible to send/receive SMS to/from any number in the world by simply using SMPP is no. I looked at a few online SMS services a year or two ago and all of the ones I looked at listed networks/countries where messages could/couldn't be sent to.

Categories

Resources