Appendix B – Detailed Examples
Multi-Tech Systems, Inc. AT Commands for Wireless Modems with IP Connectivity (S000333D)
68
Sending an Email Containing Data from the Serial
Port
This example covers the following: Sending an email message containing data from the serial port.
Description:
This command allows another processor (attached equipment) to send an email message containing
body text which is passed directly to the modem over the serial port. While the modem is connected to
the Internet, the attached equipment can initiate the sending of an email message at any time (except
when the software is already in the process of sending or retrieving email, FTP or socket TCP process).
This action is accomplished by sending an
'AT#PUTMAIL'
command over the serial port.
Sending an email
through the serial
port
The modem will send an 'Ok_Info_WaitingForData' message when it is ready to accept the data
flow to be placed in the body of the email from the serial port.
The data sent by the host over the serial port is not echoed.
Note:
When using this command, the software will use the following parameters to compose the email
header:
'SUBJ1' for the email subject
'REC1' for the recipient email address
'CCREC1' for the carbon Copy recipient -mail address
‘SENDERNAME’ & ‘SENDERADDR’ for the specified identity of the module
AT# Command: AT#PUTMAIL
The end of the email body data flow must be denoted by sending following sequence to the
module:
[CR][LF].[CR][LF]
The software will send an ‘OK’ response when it is ready to accept another command, in
case of success of the sending operation. In case of problem a ‘#CME ERROR: Value’ is
sent over the serial port.
Notes:
•
The [CR][LF].[CR][LF] keyboard sequence is:
ENTER
CTRL+ENTER
.
ENTER
CTRL+ENTER
•
If there is no answer from the SMTP server after 3 minutes, the error #CME ERROR: 37964 is
generated and the sending process is aborted.
•
A communication session must be established (AT#CONNECTIONSTART) before sending the
AT#PUTMAIL command. After the sending process, the communication session remains
established.
•
Check your terminal emulator configuration because with some configurations, this terminal can
modify data (for example, to transform the [CR] in [CR][LF]).