Table of Contents

SubmitMulti. Send message to multiple destinations

The SubmitMulti command is used to submit SMPP message for delivery to multiple recipients or to one or more Distribution Lists.

Recipients can be specified with multiple invocation of method To(String)

Client.SubmitAsync(SMS.ForSubmitMulti()
             .ServiceType("test")
             .Text("Test Test")
             .From("MyService")
             .To("1111")
             .To("2222")
             .To("3333")
             );

this can be done from phone numbers collection

var pduBuilder = SMS.ForSubmitMulti()
                .ServiceType("test")
                .Text("Test Test")
                .From("MyService");
                
foreach (string phoneNumber in phoneNumbers)
{
    pduBuilder.To(phoneNumber);
}

another possibility is to create DestinationAddress list

List<DestinationAddress> destList = new List<DestinationAddress>();

destList.Add(new DestinationAddress("11111111111", 0, 1));
destList.Add(new DestinationAddress("22222222222", 0, 1));

IList<SubmitMultiResp> submitResponses = client.Submit(SMS.ForSubmitMulti()
   .ServiceType("test")
   .Text("Test Test")
   .From("MyService")
   .ToDestinations(destList)
);

SubmitMultiResp can be received as return value in synchronous method Submit(SubmitMulti) and with event @Inetlab.SMPP.SmppClient.evSubmitMultiCompleted. When response received it means SMPP server stored message for further delivery to recipient.

SubmitMulti message for destination address is accepted by SMPP server only when you receive ESME_ROK in all responses in then result list IList<SubmitMultiResp> and destination address does not exist in UnsuccessAddresses of response.