I created a simple form that enables the user to enter the text of the
short
message, the sender name (or number), and the destination mobile number.
A
copy of the message should be stored in the database as the user sends
it. I
have created a Message model that has the required fields.
I have the following scaffold-generated create method that creates a
message
and stores it in the database:
the short message, the sender name (or number), and the destination
mobile number. A copy of the message should be stored in the
database as the user sends it. I have created a Message model that
has the required fields.
I have the following scaffold-generated create method that creates a
message and stores it in the database:
You need to have a look at the Net::HTTP libraries, which allows you
to make http requests of various sorts. If i were you, I’d add a send
method to the Message model which does the necessary dtugg.
username=xxxx&password=xxxx&mno=999999&msg=Hi from
above method?
It’s not impossible for someone in the right place at the right time
to snoop that username and password. There’s not a lot you can do
about that unless the people providing the service also provide https
access (or use some other mitigating scheme, eg only allowing requests
from certain ip addresses.
I used the library, it is easier than what I expected,:
class Message < ActiveRecord::Base
def sendsms
require “net/http”
Net::HTTP.get_response(‘www.domain.com’,‘/sendsms/sendsms.asp?username=xxxx&password=xxxx&mno=999999&msg=Hi
from rails&Sid=xxxx&fl=0&mt=0’)
end
end
Now it works but is there any possibility that the URL could be exposed
in
a way or another to some bad user? Is there something like encrypting
the
URL or something? Or is it just safe to use the above method?
For the record, all carriers have an email SMS system.
Sprint: [10-digit number]@messaging.sprintpcs.com
Cingular / ATT : [number]@txt.att.com
These services are of course free, and subject to limitations and
possibly delays. If you need to send a ton of SMSes out, or need
guarenteed quick delivery, you’ll need to look into an SMS gateway
service like clickatell.
In case of sending Unicode messages I have to convert the message’s
characters to hexadecimal, I’ve looked into Ruby documentation but it
looks
like Ruby doesn’t have enough regarding to this issue. I’ve been
searching
for hours but didn’t find a perfect solution … do you have any
suggestion
guys?
end
It’s not impossible for someone in the right place at the right time
We use an external service.
Regards
I’m creating an application to send SMS messages, I got a
mobile number. A copy of the message should be stored in the
You need to have a look at the Net::HTTP libraries, which allows @message = Message.new(params[:message])
=> :unprocessable_entity }
On Tue, 2008-03-04 at 09:43 -0500, Jason R. wrote:
For the record, all carriers have an email SMS system.
Sprint: [10-digit number]@messaging.sprintpcs.com
Cingular / ATT : [number]@txt.att.com
These services are of course free, and subject to limitations and
possibly delays. If you need to send a ton of SMSes out, or need
guarenteed quick delivery, you’ll need to look into an SMS gateway
service like clickatell.
add to that verizon…
[number]@vtext.com
Craig
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.