Can't send more than 160 characters sms C# using GSM Modem

倾然丶 夕夏残阳落幕 提交于 2019-12-02 09:29:26

Alright, so after lots and lots of effort, research and minor change in the code i have got the solution and now it's working perfectly. I'm posting the solution that worked for me and I hope it will also help those who face the same problem.

Please make sure that the GSMCOMM library is up-to-date i.e. version 1.21.0 otherwise it may not work properly.

This is the correct code snippet. It will send short messages (i.e. less or equal to 160 chars) as well as long text message (i.e. more than 160 chars) as a single sms.

OutgoingSmsPdu[] pdus = null;
comm.Open();
pdus = SmartMessageFactory.CreateConcatTextMessage(message, number);
comm.SendMessages(pdus);
comm.Close();
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!