Project

General

Profile

Wiki - Send SMS

// Create a SMS instance
Sms sms = Sms.NewInstance();    

// Set the destination number                
sms.DestinationAddress = "12345678";

// Set the message content
sms.Content = "This is a test message";

// If you are not sure, then let the library derives it for you
//sms.DataCodingScheme = MessageDataCodingScheme.DefaultAlphabet;

// Set to true for Flash message
sms.Flash = true;

// Set to request for delivery report
sms.StatusReportRequest = MessageStatusReportRequest.SmsReportRequest;

// Use this to send to Queue
if (mobileGateway.SendToQueue(sms))
{
    MessageBox.Show("Message is queued successfully for " + sms.DestinationAddress, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
}

// Use this to send synchronously
if (mobileGateway.Send(sms))
{
    MessageBox.Show("Message is sent successfully to " + sms.DestinationAddress + ". Message index is  " + sms.ReferenceNo.First(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
}

Refer to Demo program for more details