View Single Post
sakya's Avatar
Posts: 533 | Thanked: 1,341 times | Joined on Dec 2010 @ Italy
#1
Hi!

I tried to send a SMS to multiple numbers using this code:
Code:
QMessage message;
QMessageService service;

message.setType(QMessage::Sms);

QMessageAddressList receiver;
foreach(int id, toSend){
    Contact* c = CommonStatic::GetContact(id);
    if (c){
        QMessageAddress adr(QMessageAddress::Phone, c->Number);
        receiver.append(adr);
    }
}
message.setTo(receiver);
if (!service.compose(message)){
    CommonStatic::ErrorMessage(this, tr("Failed to compose SMS"));
}
The receiver list is correctly populated with QMessageAddress with the correct numbers, but the conversation window displays only one contact.

What's wrong with my code, or how can I send a SMS to multiple contacts?

Many thanks.