NG send_sms

You could send SMS message with the aid of the self.send_sms class method.

def self.send_sms ng_ip_address, username, password, to, message, port=9501, from=nil

Code example 1 - Definition

Method parameters

Parameter name Value Description Default value Mandatory
ng_ip_address string value
e.g. '192.168.0.1'
IP address of Ozeki NG SMS Gateway. (None) Yes
username string value,
e.g. 'admin'
The username to connect Ozeki NG SMS Gateway. (None) Yes
password string value,
e.g. 'password'
The password for the given username. (None) Yes
to string value
e.g. '06123456789'
Recipient of the SMS message. (None) Yes
message string value,
e.g. 'Hello world!'
The content of the SMS message. (None) Yes
port int value
e.g. 9501
The Ozeki NG SMS Gateway listener port. 9501 No
from string value
e.g. 'admin'
Sender of the SMS message. Empty string No

Example

puts NG.send_sms '192.168.0.1', 'admin', 'password', '06123456789', 'Ni hao'

Code example 2 - Send an SMS message with class method

More information