SmsSendMessage (Compact 2013)
3/26/2014
This function creates and sends a Short Message Service (SMS) message.
Syntax
HRESULT SmsSendMessage (
const SMS_HANDLE smshHandle,
const SMS_ADDRESS * const psmsaSMSCAddress,
const SMS_ADDRESS * const psmsaDestinationAddress,
const SYSTEMTIME * const pstValidityPeriod,
const BYTE * const pbData,
const DWORD dwDataSize,
const BYTE * const pbProviderSpecificData,
const DWORD dwProviderSpecificDataSize,
const SMS_DATA_ENCODING smsdeDataEncoding,
const DWORD dwOptions,
SMS_MESSAGE_ID * psmsmidMessageID
);
Parameters
- smshHandle
SMS handle obtained from calling SmsOpen.
- psmsaSMSCAddress
Optional parameter that indicates which Short Message Service Center (SMSC) the message will be routed through. If NULL (recommended), the user default SMSC will be used.
- psmsaDestinationAddress
Destination of the message.
- pstValidityPeriod
Duration for which the SMS message is valid, counted from when the SMSC receives the message. This can be NULL. This is not interpreted as a typical SYSTEMTIME structure. For details, see GSM specification 03.40 "Digital cellular telecommunications system (Phase 2+); Technical realization of the Short Message Service (SMS)" on this 3GPP website.
- pbData
Data part of the message. This can be NULL.
- dwDataSize
Size in bytes of the buffer pointed to by pbData. This can be zero.
- pbProviderSpecificData
For certain providers, a provider-specific structure must be provided in addition to the previous data buffer.
- dwProviderSpecificDataSize
Size of pbProviderSpecificData.
- smsdeDataEncoding
Text encoding of the SMS message, if it is appropriate. SMSDE_OPTIMAL is the recommended value. See the SMS_DATA_ENCODING enumeration for possible values.
dwOptions
Optional flags.Value
Description
SMS_OPTION_DELIVERY_NONE
No special options.
SMS_OPTION_DELIVERY_NO_RETRY
If this option is specified, no retries will be attempted. Otherwise, the router reties sending the SMS message according to a predefined short-term retry schedule.
[in,out] psmsmidMessageID
[in] NULL or a pointer to a storage area for the output.[out] If input was not NULL, a pointer to message ID.
The message ID can be used with SmsGetMessageStatus and other calls to identify the message.
Return Value
This HRESULT is S_OK for success, a standard error value, or one of the error constants defined in SMS Specific Errors and SMS General Errors.
Requirements
Header |
sms.h |
Library |
sms.lib |
See Also
Reference
Short Message Service Functions
SmsOpen
SMS_DATA_ENCODING
SmsGetMessageStatus