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
await _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 DistributionList
List<IAddress> destList = new List<IAddress>();
destList.Add(new SmeAddress("11111111111", AddressTON.Unknown, AddressNPI.ISDN));
destList.Add(new DistributionList("my_destribution_list_on_SMPP_Server"));
var submitResponses = await _client.SubmitAsync(SMS.ForSubmitMulti()
.ServiceType("test")
.Text("Test Test")
.From("MyService")
.ToDestinations(destList)
);
When SubmitMultiResp response received it means SMPP server stored message for further delivery to recipients.
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 UnsuccessfulDeliveries of response.