0

I have searched a lot but still couldn't find exactly what am looking for. Actually i'm working on a winforms app that will allow user to send bulk sms using GSMCOMM library with the help of a GSM Modem. What i have achieved so far is that i can send text messages that are <= 160 characters but problem begins when a message gets longer that 160 characters. I don't get any error and sms seemed to have been sent but its not actually. I'm sharing my code snippet that is used to send sms. Please have a look at it and let me know where the problem is. Thanks.

SmsSubmitPdu[] pdus; 
comm.Open();
pdus = SmartMessageFactory.CreateConcatTextMessage(message, number);
comm.SendMessages(pdus);
comm.Close();
4

1 回答 1

1

好的,所以经过大量的努力、研究和对代码的微小更改,我得到了解决方案,现在它运行良好。我正在发布对我有用的解决方案,我希望它也能帮助那些面临同样问题的人。

请确保 GSMCOMM 库是最新的,即版本 1.21.0,否则可能无法正常工作。

这是正确的代码片段。它将短消息(即小于或等于 160 个字符)和长文本消息(即大于 160 个字符)作为一条短信发送。

OutgoingSmsPdu[] pdus = null;
comm.Open();
pdus = SmartMessageFactory.CreateConcatTextMessage(message, number);
comm.SendMessages(pdus);
comm.Close();
于 2018-07-03T09:08:05.453 回答