Sending sms via rails

Hi all, Im trying to send sms via rails but it is not reached my mobile because in sms_fu.yml file there is no carrier is set for India. How can i set the carrier for send sms to India. Please anyone help me. I am using sms_fu gem for send sms.

Hey Seeni,

The first thing that comes to mind is, does sms_fu include support for your carrier there in India? Its GitHub documentation states that the "to" phone number must be exactly 10 digits long (without any non- digit characters). I'm not sure what phone numbers in India look like, but that could be one place to start.

Secondly, sms_fu appears to rely on simply sending an e-mail to <your phone number>@<your carrier's sms domain>. It just happens to have a list of known carrier e-mail to SMS domains. Behind the scenes, all it's doing is sending an e-mail to that carrier (or at least that's my understanding).

Because it's relying on e-mail, what's your action mailer configuration setting for development mode? Current versions of Rails usually set the perform_deliveries option to false for development and test environments, meaning that any e-mail that goes through ActionMailer will just be printed out to the logfile, instead of actually sent. If you're in development or test mode without having set that option to true (config/environments/development.rb or test.rb), it could be that the system isn't actually sending the e- mail to your carrier.

A couple other points to possibly think through: - Does the carrier support messages in the language (and alphabet - US-ASCII, UTF-8 or Hindi) you're using? - Are you sending an HTML-formatted e-mail, or just plain text?

One other thing to look at would be asking the carrier in question what their SMS-to-e-mail domain is. For example, here in the US, with Sprint it's <phone number>@messaging.sprintpcs.com. If the configuration for sms_fu doesn't have a known sms-to-email domain name for your carrier, you'll probably need to add it.

Good luck to you Seeni! I hope you get it figured out soon.

Thank u Fallen !!

Hey Fallen phoenix, Is there any other option available in rails to send sms?

Well, you may need to "brew your own". The most likely issue would probably be that you don't have the information for an e-mail to SMS gateway for your cell phone provider. You'd need to get that information from them. This isn't so much a "what should I use instead of sms_fu?" kind of question, it's more a question of, "how do I properly implement this?"

It's also possible that your provider doesn't support e-mail to SMS for some reason. I can't see any reason they wouldn't or couldn't, but then again, I've never been to India :slight_smile:

The only other options I can list off the top of my head would be a third party provider that you pay for API access. There are companies - at least here in the US, probably in India as well - who act as intermediaries to send SMS messages between different providers. For example, say you're on AT&T (a GSM network) and I'm on Sprint (a CDMA network). I send you a text message. It goes from my phone, to Sprint, _to the intermediary in question - whoever they are_ - to AT&T and finally to your phone. Some of these providers may have paid APIs that you can license to send the text message directly to their servers/systems, but that usually tends to be a fairly pricey option and is usually reserved for companies who need to send large volumes of SMS messages. Most of the time, these kinds of services are language agnostic, so you could build it in Ruby, PHP, Perl, Python, Scala, VB.NET, C#, whatever.

I'd start by calling up your phone company and asking, "how do I send a text message by e-mail?". That should get you started.

Good luck!

You may be after an SMS aggregator - these are companies who have relationships with carriers such as sprint, vodafone etc... and hide that complexity from you (unless you are massive you don't want to be dealing with carriers on an individual basis). Two sms aggregators I know of are openmarket & sybase365. It's a lot cheaper if you only need to send messages as opposed to receive them too (which requires leasing a number on which you receive them)

Fred

Looking at the default list of carriers supported in the sms_fu.yml file there are none listed for India. However, that does not mean that you can’t use one. As Fallen has pointed out, your carrier would have to accept email to sms (that is how sms_fu is sending messages). Depending on the carrier, users might have to opt in to get email to sms. Talk to the different carriers and find out if they do accept email to sms, what domain should the email be going to if they do, and do customers need to have that feature turned on in their accounts. After getting that information, try adding that to sms_fu to make it work. If you don’t want to hassle with all that or it is still not working, Fred’s suggestions of what companies to use to handle that service for you is a good one. Check them out.

B.