Send SMS with number of sender

U

Uwe Gebhardt

Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND, ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 
P

Peter Foot [MVP]

By default the message should be sent with the settings defined by your
operator, therefore unless you change the settings on the phone your message
should be sent with your caller id. I'm not sure why the example below
places the result of the call to SmsGetPhoneNumber into the SMSC field -
this is for the Short Message Service Centre and should be left null to use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the interop is
ready-wrapped for you - you could compare the sources to see how it is done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
 
G

Guest

Peter.
Please help me.
I am a starting programmer in compact framework.
I am using the code you recommended in opennetcf.org, but it is a wrong in
sms.dll calling.
Where I find the sms.dll. I installed compactframework 1.0 and visual studio
2003.
The error message is "It can't load sms.dll"


PD. Sorry for my writing, I from Peru

Peter Foot said:
By default the message should be sent with the settings defined by your
operator, therefore unless you change the settings on the phone your message
should be sent with your caller id. I'm not sure why the example below
places the result of the call to SmsGetPhoneNumber into the SMSC field -
this is for the Short Message Service Centre and should be left null to use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the interop is
ready-wrapped for you - you could compare the sources to see how it is done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Uwe Gebhardt said:
Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND, ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 
P

Paul G. Tobey [eMVP]

If you don't have the SMS DLL, then you are not using a device that supports
SMS or you are using one that uses some sort of non-standard SMS interface.
What device is it?

Paul T.

Johnny Salgado said:
Peter.
Please help me.
I am a starting programmer in compact framework.
I am using the code you recommended in opennetcf.org, but it is a wrong in
sms.dll calling.
Where I find the sms.dll. I installed compactframework 1.0 and visual
studio
2003.
The error message is "It can't load sms.dll"


PD. Sorry for my writing, I from Peru

Peter Foot said:
By default the message should be sent with the settings defined by your
operator, therefore unless you change the settings on the phone your
message
should be sent with your caller id. I'm not sure why the example below
places the result of the call to SmsGetPhoneNumber into the SMSC field -
this is for the Short Message Service Centre and should be left null to
use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the interop
is
ready-wrapped for you - you could compare the sources to see how it is
done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Uwe Gebhardt said:
Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND, ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 
G

Guest

Paul.
I was reading about this but I didn't understand correctly.
You can recommende me any manual or tutorial or web page where I can learn
correctly about send sms message.
I need perform a program that sends sms message from web page.

Please help me

Thanks

Paul G. Tobey said:
If you don't have the SMS DLL, then you are not using a device that supports
SMS or you are using one that uses some sort of non-standard SMS interface.
What device is it?

Paul T.

Johnny Salgado said:
Peter.
Please help me.
I am a starting programmer in compact framework.
I am using the code you recommended in opennetcf.org, but it is a wrong in
sms.dll calling.
Where I find the sms.dll. I installed compactframework 1.0 and visual
studio
2003.
The error message is "It can't load sms.dll"


PD. Sorry for my writing, I from Peru

Peter Foot said:
By default the message should be sent with the settings defined by your
operator, therefore unless you change the settings on the phone your
message
should be sent with your caller id. I'm not sure why the example below
places the result of the call to SmsGetPhoneNumber into the SMSC field -
this is for the Short Message Service Centre and should be left null to
use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the interop
is
ready-wrapped for you - you could compare the sources to see how it is
done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND, ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 
P

Peter Foot [MVP]

To use the OpenNETCF Sms class you must be using a Pocket PC Phone Edition
2002/2003/2003SE or Smartphone 2003/2003SE device.

Can you describe in a bit more detail what you are trying to achieve?

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Johnny Salgado said:
Paul.
I was reading about this but I didn't understand correctly.
You can recommende me any manual or tutorial or web page where I can learn
correctly about send sms message.
I need perform a program that sends sms message from web page.

Please help me

Thanks

Paul G. Tobey said:
If you don't have the SMS DLL, then you are not using a device that
supports
SMS or you are using one that uses some sort of non-standard SMS
interface.
What device is it?

Paul T.

message
Peter.
Please help me.
I am a starting programmer in compact framework.
I am using the code you recommended in opennetcf.org, but it is a wrong
in
sms.dll calling.
Where I find the sms.dll. I installed compactframework 1.0 and visual
studio
2003.
The error message is "It can't load sms.dll"


PD. Sorry for my writing, I from Peru

:

By default the message should be sent with the settings defined by
your
operator, therefore unless you change the settings on the phone your
message
should be sent with your caller id. I'm not sure why the example below
places the result of the call to SmsGetPhoneNumber into the SMSC
field -
this is for the Short Message Service Centre and should be left null
to
use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the
interop
is
ready-wrapped for you - you could compare the sources to see how it is
done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile
and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND, ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 
G

Guest

Ok Peter, thanks. I'll download these devices.

I need to perform a program, it sends sms message from web page to celular
phone, maybe one or two thousands messages by sending.
I don't know How start. I hope you can help me, brinding me information,
manual, tutorial or web page.
I was reading msdn, there is a example sending sms using compact framework
with vb.net, but it's wrong with message "it can't load sms.dll".
After I found your recommendation using openNETCF, but the same mistake.

What I must do?

Thank you in advance por help you can give me.

Peter Foot said:
To use the OpenNETCF Sms class you must be using a Pocket PC Phone Edition
2002/2003/2003SE or Smartphone 2003/2003SE device.

Can you describe in a bit more detail what you are trying to achieve?

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Johnny Salgado said:
Paul.
I was reading about this but I didn't understand correctly.
You can recommende me any manual or tutorial or web page where I can learn
correctly about send sms message.
I need perform a program that sends sms message from web page.

Please help me

Thanks

Paul G. Tobey said:
If you don't have the SMS DLL, then you are not using a device that
supports
SMS or you are using one that uses some sort of non-standard SMS
interface.
What device is it?

Paul T.

message
Peter.
Please help me.
I am a starting programmer in compact framework.
I am using the code you recommended in opennetcf.org, but it is a wrong
in
sms.dll calling.
Where I find the sms.dll. I installed compactframework 1.0 and visual
studio
2003.
The error message is "It can't load sms.dll"


PD. Sorry for my writing, I from Peru

:

By default the message should be sent with the settings defined by
your
operator, therefore unless you change the settings on the phone your
message
should be sent with your caller id. I'm not sure why the example below
places the result of the call to SmsGetPhoneNumber into the SMSC
field -
this is for the Short Message Service Centre and should be left null
to
use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the
interop
is
ready-wrapped for you - you could compare the sources to see how it is
done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile
and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND, ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 
P

Paul G. Tobey [eMVP]

"From a Web page" is totally useless information. Who is accessing the Web
page? Where is it hosted, on what OS, on what server? Is the page opened
by users running SmartPhone and, when you click on a link, the phone should
send an SMS message?

Paul T.

Johnny Salgado said:
Ok Peter, thanks. I'll download these devices.

I need to perform a program, it sends sms message from web page to celular
phone, maybe one or two thousands messages by sending.
I don't know How start. I hope you can help me, brinding me information,
manual, tutorial or web page.
I was reading msdn, there is a example sending sms using compact framework
with vb.net, but it's wrong with message "it can't load sms.dll".
After I found your recommendation using openNETCF, but the same mistake.

What I must do?

Thank you in advance por help you can give me.

Peter Foot said:
To use the OpenNETCF Sms class you must be using a Pocket PC Phone
Edition
2002/2003/2003SE or Smartphone 2003/2003SE device.

Can you describe in a bit more detail what you are trying to achieve?

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

message
Paul.
I was reading about this but I didn't understand correctly.
You can recommende me any manual or tutorial or web page where I can
learn
correctly about send sms message.
I need perform a program that sends sms message from web page.

Please help me

Thanks

:

If you don't have the SMS DLL, then you are not using a device that
supports
SMS or you are using one that uses some sort of non-standard SMS
interface.
What device is it?

Paul T.

message
Peter.
Please help me.
I am a starting programmer in compact framework.
I am using the code you recommended in opennetcf.org, but it is a
wrong
in
sms.dll calling.
Where I find the sms.dll. I installed compactframework 1.0 and
visual
studio
2003.
The error message is "It can't load sms.dll"


PD. Sorry for my writing, I from Peru

:

By default the message should be sent with the settings defined by
your
operator, therefore unless you change the settings on the phone
your
message
should be sent with your caller id. I'm not sure why the example
below
places the result of the call to SmsGetPhoneNumber into the SMSC
field -
this is for the Short Message Service Centre and should be left
null
to
use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the
interop
is
ready-wrapped for you - you could compare the sources to see how it
is
done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile
and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND,
ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 
G

Guest

The page will be opened by users running microsoft internet explorer 6.0,
when they accessing the web page, they input many cellular phone numbers,
then the web page (it needs to perform) sends sms message to cellular phone
that they registered.

Tha web page is running in IIS, Microsoft 2000 Server Service Pack 4

Thanks

Paul G. Tobey said:
"From a Web page" is totally useless information. Who is accessing the Web
page? Where is it hosted, on what OS, on what server? Is the page opened
by users running SmartPhone and, when you click on a link, the phone should
send an SMS message?

Paul T.

Johnny Salgado said:
Ok Peter, thanks. I'll download these devices.

I need to perform a program, it sends sms message from web page to celular
phone, maybe one or two thousands messages by sending.
I don't know How start. I hope you can help me, brinding me information,
manual, tutorial or web page.
I was reading msdn, there is a example sending sms using compact framework
with vb.net, but it's wrong with message "it can't load sms.dll".
After I found your recommendation using openNETCF, but the same mistake.

What I must do?

Thank you in advance por help you can give me.

Peter Foot said:
To use the OpenNETCF Sms class you must be using a Pocket PC Phone
Edition
2002/2003/2003SE or Smartphone 2003/2003SE device.

Can you describe in a bit more detail what you are trying to achieve?

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

message
Paul.
I was reading about this but I didn't understand correctly.
You can recommende me any manual or tutorial or web page where I can
learn
correctly about send sms message.
I need perform a program that sends sms message from web page.

Please help me

Thanks

:

If you don't have the SMS DLL, then you are not using a device that
supports
SMS or you are using one that uses some sort of non-standard SMS
interface.
What device is it?

Paul T.

message
Peter.
Please help me.
I am a starting programmer in compact framework.
I am using the code you recommended in opennetcf.org, but it is a
wrong
in
sms.dll calling.
Where I find the sms.dll. I installed compactframework 1.0 and
visual
studio
2003.
The error message is "It can't load sms.dll"


PD. Sorry for my writing, I from Peru

:

By default the message should be sent with the settings defined by
your
operator, therefore unless you change the settings on the phone
your
message
should be sent with your caller id. I'm not sure why the example
below
places the result of the call to SmsGetPhoneNumber into the SMSC
field -
this is for the Short Message Service Centre and should be left
null
to
use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the
interop
is
ready-wrapped for you - you could compare the sources to see how it
is
done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile
and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND,
ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 
P

Paul G. Tobey [eMVP]

Well, then they're running on PCs, right? Not on phones? The method to
send SMS messages is *not* going to be built into Windows. That probably
varies from TMobile to Sprint to who knows what else ([email protected]
or something, maybe). So, your question has nothing to do with Windows CE
or Pocket PC, as the Web page is *not* being viewed on that device or hosted
there? Even if you *had* the SMS.dll, you wouldn't be able to do anything
with it.

Since you will be sending these SMS messages from desktop Windows, I'd
suggest looking at MSDN for information on SMS. However, I don't think that
you'll find much there. There is a general sort of discussion about what
SMS is at the beginning of an article on PPC SMS development. It does
mention some hosting options for the store-and-forward capability of SMS:

MobileSys, Inc.
Smartserv Online, Inc.

Paul T.

Johnny Salgado said:
The page will be opened by users running microsoft internet explorer 6.0,
when they accessing the web page, they input many cellular phone numbers,
then the web page (it needs to perform) sends sms message to cellular
phone
that they registered.

Tha web page is running in IIS, Microsoft 2000 Server Service Pack 4

Thanks

Paul G. Tobey said:
"From a Web page" is totally useless information. Who is accessing the
Web
page? Where is it hosted, on what OS, on what server? Is the page
opened
by users running SmartPhone and, when you click on a link, the phone
should
send an SMS message?

Paul T.

message
Ok Peter, thanks. I'll download these devices.

I need to perform a program, it sends sms message from web page to
celular
phone, maybe one or two thousands messages by sending.
I don't know How start. I hope you can help me, brinding me
information,
manual, tutorial or web page.
I was reading msdn, there is a example sending sms using compact
framework
with vb.net, but it's wrong with message "it can't load sms.dll".
After I found your recommendation using openNETCF, but the same
mistake.

What I must do?

Thank you in advance por help you can give me.

:

To use the OpenNETCF Sms class you must be using a Pocket PC Phone
Edition
2002/2003/2003SE or Smartphone 2003/2003SE device.

Can you describe in a bit more detail what you are trying to achieve?

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile
and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

message
Paul.
I was reading about this but I didn't understand correctly.
You can recommende me any manual or tutorial or web page where I can
learn
correctly about send sms message.
I need perform a program that sends sms message from web page.

Please help me

Thanks

:

If you don't have the SMS DLL, then you are not using a device that
supports
SMS or you are using one that uses some sort of non-standard SMS
interface.
What device is it?

Paul T.

in
message
Peter.
Please help me.
I am a starting programmer in compact framework.
I am using the code you recommended in opennetcf.org, but it is a
wrong
in
sms.dll calling.
Where I find the sms.dll. I installed compactframework 1.0 and
visual
studio
2003.
The error message is "It can't load sms.dll"


PD. Sorry for my writing, I from Peru

:

By default the message should be sent with the settings defined
by
your
operator, therefore unless you change the settings on the phone
your
message
should be sent with your caller id. I'm not sure why the example
below
places the result of the call to SmsGetPhoneNumber into the SMSC
field -
this is for the Short Message Service Centre and should be left
null
to
use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the
interop
is
ready-wrapped for you - you could compare the sources to see how
it
is
done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows
Mobile
and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string
sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT,
(IntPtr)SMS_MODE_SEND,
ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent,
(int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 
G

Guest

thanks.
I think that I was looking for in the incorrect side.
Where I found "PPC SMS development", or any information about you say me.

Thanks you very much.

Paul G. Tobey said:
Well, then they're running on PCs, right? Not on phones? The method to
send SMS messages is *not* going to be built into Windows. That probably
varies from TMobile to Sprint to who knows what else ([email protected]
or something, maybe). So, your question has nothing to do with Windows CE
or Pocket PC, as the Web page is *not* being viewed on that device or hosted
there? Even if you *had* the SMS.dll, you wouldn't be able to do anything
with it.

Since you will be sending these SMS messages from desktop Windows, I'd
suggest looking at MSDN for information on SMS. However, I don't think that
you'll find much there. There is a general sort of discussion about what
SMS is at the beginning of an article on PPC SMS development. It does
mention some hosting options for the store-and-forward capability of SMS:

MobileSys, Inc.
Smartserv Online, Inc.

Paul T.

Johnny Salgado said:
The page will be opened by users running microsoft internet explorer 6.0,
when they accessing the web page, they input many cellular phone numbers,
then the web page (it needs to perform) sends sms message to cellular
phone
that they registered.

Tha web page is running in IIS, Microsoft 2000 Server Service Pack 4

Thanks

Paul G. Tobey said:
"From a Web page" is totally useless information. Who is accessing the
Web
page? Where is it hosted, on what OS, on what server? Is the page
opened
by users running SmartPhone and, when you click on a link, the phone
should
send an SMS message?

Paul T.

message
Ok Peter, thanks. I'll download these devices.

I need to perform a program, it sends sms message from web page to
celular
phone, maybe one or two thousands messages by sending.
I don't know How start. I hope you can help me, brinding me
information,
manual, tutorial or web page.
I was reading msdn, there is a example sending sms using compact
framework
with vb.net, but it's wrong with message "it can't load sms.dll".
After I found your recommendation using openNETCF, but the same
mistake.

What I must do?

Thank you in advance por help you can give me.

:

To use the OpenNETCF Sms class you must be using a Pocket PC Phone
Edition
2002/2003/2003SE or Smartphone 2003/2003SE device.

Can you describe in a bit more detail what you are trying to achieve?

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile
and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

message
Paul.
I was reading about this but I didn't understand correctly.
You can recommende me any manual or tutorial or web page where I can
learn
correctly about send sms message.
I need perform a program that sends sms message from web page.

Please help me

Thanks

:

If you don't have the SMS DLL, then you are not using a device that
supports
SMS or you are using one that uses some sort of non-standard SMS
interface.
What device is it?

Paul T.

in
message
Peter.
Please help me.
I am a starting programmer in compact framework.
I am using the code you recommended in opennetcf.org, but it is a
wrong
in
sms.dll calling.
Where I find the sms.dll. I installed compactframework 1.0 and
visual
studio
2003.
The error message is "It can't load sms.dll"


PD. Sorry for my writing, I from Peru

:

By default the message should be sent with the settings defined
by
your
operator, therefore unless you change the settings on the phone
your
message
should be sent with your caller id. I'm not sure why the example
below
places the result of the call to SmsGetPhoneNumber into the SMSC
field -
this is for the Short Message Service Centre and should be left
null
to
use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the
interop
is
ready-wrapped for you - you could compare the sources to see how
it
is
done
differently:-
http://www.opennetcf.org/sourcebrow...Pub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows
Mobile
and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups

Hello *,

I created a class, which allows me to send a SMS.
I used the sendSMS example from Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)

Okay, it works fine, I can send a SMS, but only without
my own number. The receiver gets an anonymous message.
I already tried to change some options in the code, but
the SMS is still missing the number of the sender.

My code:

unsafe public bool sendSMS(string sPhoneNumber, string
sMessage)
{
System.IntPtr hSms = IntPtr.Zero;
IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT,
(IntPtr)SMS_MODE_SEND,
ref
hSms,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;
Byte[] bDest = new Byte[516];
Byte[] bDest2 = new Byte[516];

fixed (byte* pAddr = bDest)
{
fixed (byte* pAddr2 = bDest2)
{
byte *pCurrent = pAddr;
IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);

Marshal.WriteInt32((IntPtr)pCurrent,
(int)AddressType.Unknown);
pCurrent +=4;
foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
{
Marshal.WriteByte((IntPtr)pCurrent, b);
pCurrent++;
}

Byte[] ProvData = new Byte[12];
byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
int nMsgSize = bMessage.Length;

res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
IntPtr.Zero);
if (res != IntPtr.Zero)
return false;

SmsClose(hSms);
return true;
}
}
}

Any ideas, what I'm doing wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top