Click here to Skip to main content
15,911,360 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I was doing SMS simple project with C# window application . I used GSM modem device to send message.Firstly I chose modem port and the connection was done successfully but when I tried to send a SMS ,
I got error " (GsmComm.GsmCommunication.CommException)" .
//Code
Operation code = new Operation();
try
{
txtNumber.Text = "0973118993";
Cursor.Current = Cursors.WaitCursor;
txtMessage.Text = "Respected " + txtDonorName.Text + ", Welcome to Clapp Trust. Your donor ID is " + txtDonorId.Text + ". Our online system will send you SMS whenever your donation is received.";
try
{
SmsSubmitPdu pdu;
byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha7BitDefault;
pdu = new SmsSubmitPdu(txtMessage.Text, Convert.ToString(txtNumber.Text), dcs );

int times = 1;
for (int i = 0; i < times; i++)
{
comm.SendMessage(pdu);
}
}
catch (Exception ex)
{
MessageBox.Show("Modem is not available");

}
}
catch
{
MessageBox.Show("SMS not send");
}
What's the problem?
Posted

1 solution

the github page for the GsmComm DLL (GsmCommunication.CommException) https://github.com/welly87/GSMComm/blob/master/GSMCommShared/GsmCommunication/CommException.cs[^] suggests there is more information that should be returned by the exception

Maybe that will help

'g'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900