Home
RECOMMENDED FOR YOU:
SMS Gateway software
Ozeki brings you outstanding
SMS Gateway technology. Use our SMS Server products on Windows,Linux, or Android

C# SMS API
Developers can use our C# SMS API to send SMS from C#.Net. The C# SMS API comes with full source code

PHP SMS API
The ozeki PHP SMS gateway software can be used to send SMS from PHP and to receive SMS usig PHP on your website

SMPP SMS Gateway
SMS service providers use our SMPP gateway solution, that offers a high performance SMPP server and SMPP client gateway with amazing routing capabilities

C# SMS API delivery failed

SMS delivery reports for failed SMS messages are handled the same way in the C# SMS API as SMS delivery reports for successful SMS delivery. The only difference is that the Ozeki SMS gateway raises the OnMessageDeliveryFailed event, and it attaches an error message to the report if the mobile network returns a delivery report with a failed status.

C# SMS API - sms delivery failed
Figure 1 - C# SMS API - sms delivery failed

The C#/.Net SMS api sms delivery failed event

The sms delivery failed event in the C# SMS api arrives when the mobile network considers an SMS message undeliverable. This can happen if the destination mobile phone is never switched on or is roaming in an unaccessible network. Some SMS service providers do not send SMS delivery reports with failed status codes.

To handle the SMS delivery failed report in your C# SMS API follow these steps:

  • Subscrbe for the OnMessageDeliveryFailed event in your C# SMS API class
  • Write the C# code to process the SMS delivery failed report
  • Send an SMS, and save the sms message ID.
  • Process the incoming SMS delivery failed report in your C# sms api class

C# sms api sms delivery failed report example:

Client.OnMessageDeliveryFailed += Client_OnMessageDeliveryFailed;

static void Client_OnMessageDeliveryFailed(object sender, OzxArgs<string, DateTime, string> e)
{
    Console.WriteLine("Message delivery failed. ID: " + e.Item1 + " Date: " + e.Item2 + " Reason: " + e.Item3);
}

The C#/.NET sms api receives the date of failure and the error code in addition to the SMS messages ID of the originally sent SMS message.

For Android SMS Gateway setups, you receive this event, when the android phone receives the delivery failed report. If your SMS Server runs on a PC, this SMS delivery failed event will be triggered when the delivery failed report is received on the configure mobile network connection.

More information