You are on page 1of 15

SIMCom_3G_EMAIL_Application

Note_V1.10
Smart Machine Smart Decision

Document Title: SIMCom_3G_EMAIL_Application Note

Version: 1.10

Date: 2015-02-03

Status: Release

Document Control ID: SIMCom_3G_EMAIL_Application Note _V1.10

General Notes
SIMCom offers this information as a service to its customers, to support application and
engineering efforts that use the products designed by SIMCom. The information provided is based
upon requirements specifically provided to SIMCom by the customers. SIMCom has not
undertaken any independent search for additional relevant information, including any information
that may be in the customer’s possession. Furthermore, system validation of this product designed
by SIMCom within a larger electronic system remains the responsibility of the customer or the
customer’s system integrator. All specifications supplied herein are subject to change.

Copyright
This document contains proprietary technical information which is the property of SIMCom
Limited., copying of this document and giving it to others and the using or communication of the
contents thereof, are forbidden without express authority. Offenders are liable to the payment of
damages. All rights reserved in the event of grant of a patent or the registration of a utility model
or design. All specification supplied herein are subject to change without notice at any time.

Copyright © Shanghai SIMCom Wireless Solutions Ltd. 2013

SIMCom_3G_EMAIL_Application Note _V1.10 2 2015-02-03


Smart Machine Smart Decision

Contents

1 Introduction............................................................................................................................... 5
1.1 Features........................................................................................................................... 5

2 AT commands............................................................................................................................ 6

3 Examples.................................................................................................................................... 6
3.1 Bearer profile.................................................................................................................. 7
3.2 Send an Email................................................................................................................. 7
3.3 Send a UTF-8 Email....................................................................................................... 8
3.4 Abort Email Sending.......................................................................................................9
3.5 Retrieve an Email............................................................................................................9
3.6 Retrieve and Delete an Email....................................................................................... 10
3.7 Abort an Email Retrieve............................................................................................... 12
3.8 Read an Email body in EFS.......................................................................................... 13

Appendix.......................................................................................................................................... 14
A Related Documents...........................................................................................................14
B Terms and Abbreviations..................................................................................................14

SIMCom_3G_EMAIL_Application Note _V1.10 3 2015-02-03


Smart Machine Smart Decision

Version History
Date Version Description of change Author
2011-11-09 V1.00 New version weiyingfei
2013-12-26 V1.10 Rewrite using new document template songjin

Scope

This document presents the AT command of EMAIL operation and application examples. This
document can apply to SIMCom 3G modules, including
SIM5218/SIM5215/SIM5216/SIM5320/SIM5310/SIM6320/SIM6216 series modules.

SIMCom_3G_EMAIL_Application Note _V1.10 4 2015-02-03


Smart Machine Smart Decision

1 Introduction

This document presents the AT command of Email operation for SIMCom 3G modules.

1.1 Features

1. SIMCom 3G series supports to send an Email with an attachment via SMTP protocol. It
also supports carbon copy (abbreviated Cc:) recipient and blind carbon copy
(abbreviated Bcc:) recipient.
2. SIMCom 3G series supports to retrieve and delete the Email via POP3 protocol, the
Email may be with attachments.
3. SIMCom 3G series supports all of POP3 commands but APOP. By these POP3
commands, you can get the specific Email’s size and header.
4. SIMCom 3G series does not support that SMTP and POP3 operations are executed at
the same time.

SIMCom_3G_EMAIL_Application Note _V1.10 5 2015-02-03


Smart Machine Smart Decision

2 AT commands

Below is the email associated with AT commands, detailed information please refer to
document [1].
Through these AT commands can achieve the following functions.
1) Via the SMTP protocol to send e-mail with attachments.
2) Through the POP3 protocol to accept or delete e-mail.
3) To obtain the specified mail message (size and header).

Command Description
AT+SMTPSRV Set SMTP Server Address and Port
AT+SMTPAUTH Set User Name and Password for SMTP Authentication
AT+SMTPFROM Set Sender Address and Name
AT+SMTPRCPT Set the Email Recipient(TO/CC/BCC) Address and Name
AT+SMTPSUB Set the Email Subject
AT+SMTPBODY Set the Email Body
AT+SMTPBCH Set the Email Body Character Set
AT+SMTPFILE Set the Email Attachment
AT+SMTPSEND Send the Email
AT+SMTPSTOP Stop SMTP Sending
AT+POP3SRV Set POP3 Server and Account
AT+POP3IN Log In POP3 Server
AT+POP3NUM Get Email Number and Total Size
AT+POP3LIST Get the Specific Email Size
AT+POP3HDR Get the Specific Email Header
AT+POP3GET Download Email Content to EFS
AT+POP3READ Read an Email from EFS.
AT+POP3DEL Mark the Specific Email to Delete
AT+POP3STOP Force to stop receiving Email and Close the Session
AT+POP3OUT Log Out POP3 Server

3 Examples
SIMCom_3G_EMAIL_Application Note _V1.10 6 2015-02-03
Smart Machine Smart Decision

There are some examples to explain how to use these commands.

In the "Grammar" columns of following tables, input of AT commands are in black , module
return values are in blue.

3.1 Bearer profile

Grammar Description
AT+CGSOCKCONT=1,"IP","apn" Configure bearer profile 1
OK

AT+CSOCKSETPN=1
OK

3.2 Send an Email

Grammar Description
AT+SMTPSRV="mail.sim.com",25 Set SMTP server address and port
OK
AT+SMTPAUTH=1,"john","123456" Set user name and password
OK
AT+SMTPFROM="john@sim.com","john" Set sender address and name
OK
AT+SMTPRCPT=0,0,"john@sim.com","john" Set the recipient(To:)
OK
AT+SMTPRCPT=1,0,"john@sim.com","john" Set the recipient(Cc:)
OK
AT+SMTPRCPT=2,0,"john@sim.com","john" Set the recipient(Bcc:)
OK
AT+SMTPSUB="Test" Set the subject
AT+SMTPBODY="This is my test mail" Set the body
OK
AT+FSCD=C:/Picture Switch to C:/Picture directory
+FSCD: C:/Picture

OK
AT+FSLS List files under C:/Picture directory
+FSLS: FILES:
20100202_100006.jpg
20100202_100016.jpg

OK

SIMCom_3G_EMAIL_Application Note _V1.10 7 2015-02-03


Smart Machine Smart Decision

AT+SMTPFILE=1,"20100202_100006.jpg" Add attachment


OK
AT+SMTPFILE=2,"20100202_100016.jpg" Add attachment
OK
AT+SMTPSEND Send the Email
+SMTP: OK
OK

+SMTP: SUCCESS

3.3 Send a UTF-8 Email

Grammar Description
AT+SMTPSRV="mail.sim.com",25 Set SMTP server address and port
OK
AT+SMTPAUTH=1,"john","123456" Set user name and password
OK
AT+SMTPFROM="john@sim.com","john" Set sender address and name
OK
AT+SMTPRCPT=0,0,"john@sim.com","john" Set the recipient(To:)
OK
AT+SMTPRCPT=1,0,"john@sim.com","john" Set the recipient(Cc:)
OK
AT+SMTPRCPT=2,0,"john@sim.com","john" Set the recipient(Bcc:)
OK
AT+SMTPSUB={non-ascii}"E6B58BE8AF95E982AE Set the utf-8 subject
E4BBB6"
AT+SMTPBODY Set the body of UTF-8 format
> … //utf-8 format stirng<Ctrl+Z>
OK
AT+SMTPBCH="utf-8" Set the email body character set
OK
AT+FSCD=C:/Picture Switch to C:/Picture directory
+FSCD: C:/Picture

OK
AT+FSLS List files under C:/Picture directory
+FSLS: FILES:
20100202_100006.jpg
20100202_100016.jpg

SIMCom_3G_EMAIL_Application Note _V1.10 8 2015-02-03


Smart Machine Smart Decision

OK
AT+SMTPFILE=1,"20100202_100006.jpg" Add attachment
OK
AT+SMTPFILE=2,"20100202_100016.jpg" Add attachment
OK
AT+SMTPSEND Send the Email
+SMTP: OK
OK

+SMTP: SUCCESS

3.4 Abort Email Sending

Grammar Description
AT+SMTPSEND Use AT+SMTPSTOP to cancel
+SMTP: OK sending mail
OK
AT+SMTPSTOP
OK
+SMTP: USER CANCEL

3.5 Retrieve an Email

Grammar Description
AT+POP3SRV="pop3.server.com","un","pwd",110 Set POP3 server and login parameters
OK
AT+POP3IN Login POP3 server
+POP3: SUCCESS

OK
AT+POP3NUM Check total number of email on POP3
+POP3: 2 2134 server

OK
AT+POP3LIST=1 Check the first mail size
+POP3: 1, 1050

OK
AT+POP3HDR=1 Check the first mail header
From: "FromName" <FromAddr@server.com>
Date: Tue, 9 Mar 2010 17:11:30 +0800

SIMCom_3G_EMAIL_Application Note _V1.10 9 2015-02-03


Smart Machine Smart Decision

Subject: First Test Email

OK
AT+POP3LIST=2 Check the second mail size
+POP3: 2, 1084

OK
AT+POP3HDR=2 Check the second mail header
From: "FromName" <FromAddr@server.com>
Date: Tue, 9 Mar 2010 17:16:27 +0800
Subject: Second Test Email

OK
AT+POP3GET=1 Retrieve the first mail
OK

+POP3: SUCCESS
C:/Email/100202110457/, EMAIL000.TXT
AT+POP3READ Read the mail body that has just been
Date: Tue, 9 Mar 2010 17:11:30 +0800 downloaded using AT+POP3GET
From: "FromName" <FromAddr@server.com>
To: "ToName" <ToAddr@server.com>
Subject: First Test Email

This is a test email with an attachment.

OK
AT+POP3OUT Logout the POP3 server
+POP3: SUCCESS

OK

3.6 Retrieve and Delete an Email

Grammar Description
AT+POP3SRV="pop3.server.com","un","pwd",110 Set POP3 server and login parameters
OK
AT+POP3IN Login POP3 server
+POP3: SUCCESS

OK
AT+POP3NUM Check total number of email on POP3

SIMCom_3G_EMAIL_Application Note _V1.10 10 2015-02-03


Smart Machine Smart Decision

+POP3: 2 2134 server

OK
AT+POP3LIST=1 Check the first mail size
+POP3: 1, 1050

OK
AT+POP3HDR=1 Check the first mail header
From: "FromName" <FromAddr@server.com>
Date: Tue, 9 Mar 2010 17:11:30 +0800
Subject: First Test Email

OK
AT+POP3LIST=2 Check the second mail size
+POP3: 2, 1084

OK
AT+POP3HDR=2 Check the second mail header
From: "FromName" <FromAddr@server.com>
Date: Tue, 9 Mar 2010 17:16:27 +0800
Subject: Second Test Email

OK
AT+POP3GET=1 Retrieve the first mail
OK

+POP3: SUCCESS
C:/Email/100202110457/, EMAIL000.TXT
AT+POP3READ Read the mail body that has just been
Date: Tue, 9 Mar 2010 17:11:30 +0800 downloaded using AT+POP3GET
From: "FromName" <FromAddr@server.com>
To: "ToName" <ToAddr@server.com>
Subject: First Test Email

This is a test email with an attachment.

OK
AT+POP3DEL=1 Delete the first mail
+POP3: SUCCESS

OK
AT+POP3OUT Logout the POP3 server
+POP3: SUCCESS

SIMCom_3G_EMAIL_Application Note _V1.10 11 2015-02-03


Smart Machine Smart Decision

OK

3.7 Abort an Email Retrieve

Grammar Description
AT+POP3SRV="pop3.server.com","un","pwd",110 Set POP3 server and login parameters
OK
AT+POP3IN Login POP3 server
+POP3: SUCCESS

OK
AT+POP3NUM Check total number of email on POP3
+POP3: 2 2134 server

OK
AT+POP3LIST=1 Check the first mail size
+POP3: 1, 1050

OK
AT+POP3HDR=1 Check the first mail header
From: "FromName" <FromAddr@server.com>
Date: Tue, 9 Mar 2010 17:11:30 +0800
Subject: First Test Email

OK
AT+POP3LIST=2 Check the second mail size
+POP3: 2, 1084

OK
AT+POP3HDR=2 Check the second mail header
From: "FromName" <FromAddr@server.com>
Date: Tue, 9 Mar 2010 17:16:27 +0800
Subject: Second Test Email

OK
AT+POP3GET=1 Try to retrieve the first mail
OK
AT+POP3STOP Stop the retrieve operation and close
OK the session

SIMCom_3G_EMAIL_Application Note _V1.10 12 2015-02-03


Smart Machine Smart Decision

3.8 Read an Email body in EFS

Grammar Description
AT+FSCD=C:/Email Switch to C:/Email directory
+FSCD: C:/Email

OK
AT+FSLS List how many mails has been
+FSLS: SUBDIRECTORIES: downloaded to EFS
100202110457
100202113456

OK
AT+POP3READ=0,"100202110457/EMAIL000.TXT" Read mail body content
Date: Tue, 9 Mar 2010 17:11:30 +0800
From: "FromName" <FromAddr@server.com>
To: "FromName" <ToAddr@server.com>
Subject: First Test Email

This is a test email with an attachment.

OK

SIMCom_3G_EMAIL_Application Note _V1.10 13 2015-02-03


Smart Machine Smart Decision

Appendix

A Related Documents

SN Document name Remark


[1] SIMCOM_SIM5215_SIM5216_ATC_EN_V
1.24.doc

B Terms and Abbreviations

Abbreviation Description
GPRS General Packet Radio Service
IP Internet Protocol
EMAIL Electronic Mail
SMTP Simple Mail Transfer Protocol
POP3 Post Office Protocol 3

SIMCom_3G_EMAIL_Application Note _V1.10 14 2015-02-03


Smart Machine Smart Decision

Contact us:
Shanghai SIMCom Wireless Solutions Co.,Ltd.
Address: Building A, SIM Technology Building, No. 633, Jinzhong Road, Shanghai,
P. R. China 200335
Tel: +86 21 3252 3300
Fax: +86 21 3252 2030
URL: www.sim.com/wm

SIMCom_3G_EMAIL_Application Note _V1.10 15 2015-02-03

You might also like