Specifications

Chapter 13 – Short Message Service (SMS) Commands
Multi-Tech Systems, Inc. AT Commands for EDGE Modems (S000371B) 177
13.7 AT+CMGS Send SMS Message
Description: The write command transmits a short message from TE to network (SMS-SUBMIT).
After invoking the write command, wait for the prompt “>”, and then start to write the
message. To send the message simply enter <CTRL-Z>. After the prompt, a timer will be
started to observe the input.
To abort sending use <ESC>. Abortion is acknowledged with “OK”, though the message
will not be sent.
The message reference <mr> is returned to the TE on successful message delivery. The
value can be used to identify the message in a delivery status report provided as an
unsolicited result code.
Test Command Syntax: AT+CMGS=?
Response: OK
Write Command Syntax: If text mode (see AT+CMGF=1)
AT+CMGS=<da>[, <toda>]<CR> Text can be entered. <CTRL-Z>/<ESC>
Response: +CMGS: <mr>[, <scts>]
OK
If sending fails see notes below.
Write Command Syntax: If PDU mode (see AT+CMGF=0)
AT+CMGS=<length><CR> PDU can be entered. <CTRL-Z>/<ESC>
Response: +CMGS: <mr>[, <ackpdu>]
OK
If sending fails see notes below.
Notes:
If sending fails, for example, if a message is too long, the result code depends on the current setting of the
AT^SM20 command:
If the AT^SM20 <CmgwMode> equals 1 (factory default) any failure to send a message is responded with “OK”.
Users should be aware, that despite the “OK” response, the message will not be sent to the subscriber.
If the AT^SM20 <CmgwMode> equals 0 any failure to send a message is responded with “ERROR”.
If sending fails due to timeout, then AT^SM20 <CmgwMode>=1 causes “+CMS ERROR: Unknown error” to be
returned; AT^SM20 <CmgwMode>=0 causes “+CMS ERROR: timer expired” to be returned.
Note that some providers do not recognize an @ symbol used in a short message. A widely used alternative is
typing “*” as defined in GSM 03.40 (GPP TS 23.40).
All characters entered behind the prompt “>” will be recognized as GSM characters. For example, “Backspace”
(ASCII character 8) does not delete a character, but will be inserted into the short message as an additional
physical character. As a result, the character you wanted to delete still appears in the text, plus the GSM code
equivalent of the Backspace key.
In text mode, the maximum length of a short message depends on the used coding scheme: It is 160 characters
if the 7 bit GSM coding scheme is used, and 140 characters according to the 8 bit GSM coding scheme.
At baudrates lower than 19200 it is recommended to use the line termination character only (refer to <n> of
ATS3, default <CR>) before entering text or PDU. Use of the line termination character followed by the response
formatting character (see <n> of ATS4, default <LF>) can cause problems.