Quectel GSM SMTP AT Commands Manual V1.2
User Manual:
Open the PDF directly: View PDF
.
Page Count: 21
| Download | |
| Open PDF In Browser | View PDF |
Quectel Cellular Engine GSM SMTP AT Commands GSM_SMTP_ATC_V1.2 GSM_SMTP_ATC_V1.2 Document Title GSM SMTP AT Commands Version 1.2 Date 2015-04-08 Status Release Document Control ID GSM_SMTP_ATC_V1.2 l e t l c a e i t u n Q ide f n o C General Notes Quectel offers this information as a service to its customers, to support application and engineering efforts that use the products designed by Quectel. The information provided is based upon requirements specifically provided to Quectel by the customers. Quectel 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 Quectel 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 Quectel Limited. The copying of this document, distribution to others, and communication of the contents thereof, are forbidden without express authority. Offenders are liable to the payment of damages. All rights are reserved in the event of a patent grant or registration of a utility model or design. All specification supplied herein are subject to change without notice at any time. Copyright © Quectel Wireless Solutions Co., Ltd. 2015 GSM_SMTP_ATC_V1.2 -1- GSM_SMTP_ATC_V1.2 Contents 0. Revision history ............................................................................................................................ 3 1. Introduction ................................................................................................................................... 4 1.1. Reference............................................................................................................................. 4 1.2. Terms and abbreviations ...................................................................................................... 4 2. AT Commands for SMTP Service ................................................................................................ 5 2.1. Overview of AT commands for SMTP service ................................................................... 5 2.2. Detailed description of AT commands for SMTP service .................................................. 5 2.2.1. AT+QSMTPUSER Set the user name for authentication ................................... 5 2.2.2. AT+QSMTPPWD Set the password for authentication ...................................... 6 2.2.3. AT+QSMTPADDR Set the email address of the sender ..................................... 6 2.2.4. AT+QSMTPNAME Set the sender’s name ........................................................ 7 2.2.5. AT+QSMTPSRV Set the address and port of SMTP server ............................... 8 2.2.6. AT+QSMTPDST Add or delete recipients ......................................................... 8 2.2.7. AT+QSMTPSUB Edit the subject of the email .................................................. 9 2.2.8. AT+QSMTPBODY Edit the content of the email............................................. 10 2.2.9. AT+QSMTPATT Add an attachment for the email ........................................... 11 2.2.10. AT+QSMTPDATT Delete an attachment ......................................................... 12 2.2.11. AT+QSMTPCLR Clear all the configurations and contents of the email ......... 13 2.2.12. AT+QSMTPCFG SMTP configurations ........................................................... 14 2.2.13. AT+QSMTPPUT Send email ........................................................................... 14 3. Summary of Error Codes ............................................................................................................ 16 4. Examples ..................................................................................................................................... 17 4.1. Configure SMTP server..................................................................................................... 17 4.2. Configure the information of sender ................................................................................. 17 4.3. Add recipients.................................................................................................................... 17 4.4. Edit the content of the email.............................................................................................. 18 4.5. Add a file in UFS as attachment ........................................................................................ 19 4.6. Send email ......................................................................................................................... 19 l e t l c a e i t u n Q ide f n o C GSM_SMTP_ATC_V1.2 -2- GSM_SMTP_ATC_V1.2 0. Revision history Revision Date Author Description of change 1.00 2010-04-23 Colin HU Initial 1.1 2010-08-03 Colin HU Add the description about how to add the file in UFS or SD or RAM as the attachment. 1.2 2015-04-08 Laguna XU Added applicable modules l e t l c a e i t u n Q ide f n o C GSM_SMTP_ATC_V1.2 -3- GSM_SMTP_ATC_V1.2 1. Introduction Quectel Module provides an internal TCP/IP stack that is driven by AT commands and enables the host application to easily access the internet service. It includes TCP service, UDP service, HTTP service, FTP service and SMTP service, etc. This document is a reference guide to all the AT commands and responses defined for SMTP service. This document is applicable to all Quectel GSM modules. l e t l c a e i t u n Q ide f n o C 1.1. Reference Table 1: Reference SN Document name Remark [1] Mxx_ATC The introduction of AT commands for Quectel Module [2] GSM_TCPIP_AN To introduce how to use the internal TCP/IP stack [3] GSM_File_ATC To introduce the AT commands for the file system 1.2. Terms and abbreviations Table 2: Terms and abbreviations Abbreviation Description APN Access Point Network CSD FTP GPRS HTTP SMTP TCP UART UDP UFS GSM_SMTP_ATC_V1.2 Circuit Switched Data File Transfer Protocol General Packet Radio Service Hypertext Transfer Protocol Simple Mail Transfer Protocol Transmission Control Protocol Universal Asynchronous Receiver/Transmitter User Datagram Protocol User File Storage. Please refer to [3] -4- GSM_SMTP_ATC_V1.2 2. AT Commands for SMTP Service 2.1. Overview of AT commands for SMTP service Command Description AT+QSMTPUSER SET THE USER NAME FOR AUTHENTICATION AT+QSMTPPWD SET THE PASSWORD FOR AUTHENTICATION AT+QSMTPADDR SET THE EMAIL ADDRESS OF THE SENDER AT+QSMTPNAME SET THE SENDER’S NAME AT+QSMTPSRV SET THE ADDRESS AND PORT OF SMTP SERVER AT+QSMTPDST ADD OR DELETE RECIPIENTS AT+QSMTPSUB EDIT THE SUBJECT OF THE EMAIL AT+QSMTPBODY EDIT THE CONTENT OF THE EMAIL AT+QSMTPATT ADD AN ATTACHMENT FOR THE EMAIL AT+QSMTPDATT DELETE AN ATTACHMENT AT+QSMTPCLR CLEAR ALL THE CONFIGURATIONS AND CONTENTS OF THE EMAIL AT+QSMTPCFG SMTP CONFIGURATIONS AT+QSMTPPUT SEND EMAIL l e t l c a e i t u n Q ide f n o C 2.2. Detailed description of AT commands for SMTP service 2.2.1. AT+QSMTPUSER Set the user name for authentication AT+QSMTPUSER Set the user name for authentication Test Command Response AT+QSMTPUSE +QSMTPUSER: "USER" R=? OK Parameters See Write Command. Read Command Response AT+QSMTPUSE +QSMTPUSER: "" R? OK Parameters See Write Command. Write Command Response AT+QSMTPUSE If format is right and it is not sending a mail, response GSM_SMTP_ATC_V1.2 -5- GSM_SMTP_ATC_V1.2 R=" " OK Otherwise response ERROR Parameters The user name for the authentication. The maximum size of the parameter is 50. Reference 2.2.2. AT+QSMTPPWD Set the password for authentication l e t l c a e i t u n Q ide f n o C AT+QSMTPPWD Test Command AT+QSMTPPW D=? Set the Password for Authentication Response +QSMTPPWD: "PASSWORD" OK Parameters See Write Command. Read Command Response AT+QSMTPWD +QSMTPPWD: "<****>" ? OK Parameters See Write Command. Write Command AT+QSMTPPW D=" " Response If format is right and it is not sending email, response OK Otherwise response ERROR Parameters <****> The password for the authentication. The maximum size of the parameter is 50. Mask for the password Reference 2.2.3. AT+QSMTPADDR Set the email address of the sender AT+QSMTPADDR Test Command AT+QSMTPAD DR=? Set the email address of the sender Response +QSMTPADDR: "ADDRESS" OK GSM_SMTP_ATC_V1.2 -6- GSM_SMTP_ATC_V1.2 Parameters See Write Command Read Command AT+QSMTADD R? Response +QSMTPADDR: " " OK Parameters See Write Command Write Command AT+QSMTPAD DR=" " Response If format is right and it is not sending email, response OK l e t l c a e i t u n Q ide f n o C Otherwise response ERROR Parameters The email address of the sender. Reference 2.2.4. AT+QSMTPNAME Set the sender’s name AT+QSMTPNAME Test Command AT+QSMTPNA ME=? Set the sender’s name Response +QSMTPNAME: "NAME" OK Parameters See Write Command Read Command AT+QSMTPNA ME? Response +QSMTPNAME: " " OK Parameters See Write Command Write Command AT+QSMTPNA ME=" " Response If format is right and it is not sending email, response OK Otherwise response ERROR Parameters GSM_SMTP_ATC_V1.2 -7- GSM_SMTP_ATC_V1.2 The sender’s name that will be shown when the recipients receive the email. Reference 2.2.5. AT+QSMTPSRV Set the address and port of SMTP server AT+QSMTPSRV Set the address and port of SMTP server Test Command Response AT+QSMTPSRV +QSMTPSRV: "SERVER",(1-65535) =? OK Parameters See Write Command l e t l c a e i t u n Q ide f n o C Read Command Response AT+QSMTPSRV OK ? +QSMTPSRV: " ", Parameters See Write Command Write Command Response AT+QSMTPSRV If format is right and it is not sending email, response =" ",< OK port> Otherwise, response ERROR Parameters The IP address or domain name of the SMTP server. The port of the SMTP server. Reference 2.2.6. AT+QSMTPDST Add or delete recipients AT+QSMTPDST Add or delete recipients Test Command Response AT+QSMTPDST +QSMTPDST: (0,1),(1-3),"ADDRESS" =? OK Parameters See Write Command GSM_SMTP_ATC_V1.2 -8- GSM_SMTP_ATC_V1.2 Read Command Response AT+QSMTPDST [+QSMTPDST: ," "[ …]] ? OK Parameters See Write Command Write Command Response AT+QSMTPDST If format is right and it is not sending email, response = [, [," "]] +QSMTPDST: Otherwise, response ERROR l e t l c a e i t u n Q ide f n o C Parameters A numeric to indicate to add a recipient or delete a recipient. 0 delete 1 add A numeric to indicate the type of the recipient. 1 receiver 2 copy receiver 3 secret receiver The email address of the recipient to add or delete. A numeric to indicate the result of the operation. If it is a negative numeric, it is the type of error (Please refer to the chapter 3). If it is 0, it means the operation is successful. X Reference 2.2.7. X Note: If equals 0, i.e. try to delete recipients, then if is default, this command will delete all the recipients whose type is same as what defines, and then if is also default, this command will delete all the recipients. The maximum number of the recipients is 20. AT+QSMTPSUB Edit the subject of the email AT+QSMTPSUB Edit the subject of the email Test Command Response AT+QSMTPSUB +QSMTPSUB: (0-3),"TITLE" =? OK Parameters See Write Command GSM_SMTP_ATC_V1.2 -9- GSM_SMTP_ATC_V1.2 Read Command Response AT+QSMTPSUB +QSMTPSUB: ," " ? OK Parameters See Write Command Write Command Response AT+QSMTPSUB If format is right and it is not sending email, response = ," " Otherwise, response ERROR l e t l c a e i t u n Q ide f n o C Parameters A numeric to indicate the character set of the title. 0 ASCII 1 UTF-8 2 GB2312 3 BIG5 A string as the title of the email. If is 0, this string will be as the title of the email. Otherwise, it is formatted as a hexadecimal number string, e.g. “41” means the HEX value 0x41. The length of is 0-100 if the character set is ASCII. The length of is 0-200 if the character set is not ASCII. Reference 2.2.8. AT+QSMTPBODY Edit the content of the email AT+QSMTPBODY Edit the content of the email Test Command AT+QSMTPBO DY=? Response +QSMTPBODY: (0-3),(1-48000) OK Parameters See Write Command Write Command AT+QSMTPBO DY= [, ] Response If format is right and it is not sending email, response OK CONNECT +QSMTPBODY: Otherwise, response GSM_SMTP_ATC_V1.2 - 10 - GSM_SMTP_ATC_V1.2 ERROR Parameters A numeric to indicate the character set of the title. 0 ASCII 1 UTF-8 2 GB2312 3 BIG5 The maximum time to download email body from UART. The unit is second. If it is default, the maximum time is infinite. A numeric to indicate the result to input email body. If it is a negative numeric, it is the same as (Please refer to the chapter 3). If is not a negative numeric, it represents the length of the input email body data. l e t l c a e i t u n Q ide f n o C X Reference 2.2.9. X Note: 1. "+++" is used to end downloading email body. 2. The maximum size of the email body is 10 Kbytes. AT+QSMTPATT Add an attachment for the email AT+QSMTPATT Add an attachment for the email Test Command Response AT+QSMTPATT +QSMTPATT: "FILE NAME", ,(1-48000) =? OK Read Command Response AT+QSMTPATT [+QSMTPATT: ," ", ……] ? OK Parameters See Write Command Write Command AT+QSMTPATT =" "[, , ] Response If format is right and it is not sending email, response OK If the data of the attachment fill will be input via UART and the UART enters data mode successfully, response CONNECT After the attachment has been attached successfully, response +QSMTPATT: Otherwise, response ERROR GSM_SMTP_ATC_V1.2 - 11 - GSM_SMTP_ATC_V1.2 Parameters The index of the attachment. A string as the file name of the attachment to add. If it is started with "/UFS/", it will get the specified file in UFS as the attachment. And in M33, it is also supported to get the file in the directory of "Picture" of SD and RAM as the attachment, but it is necessary to add "/SD/" before the file name for the file in the directory "Picture" of SD card and "/RAM/" before the filename for the file in RAM. the size of the attachment to add. The range is 0-102400. The unit is byte. For the file in UFS or SD or RAM, this parameter is default and the size of the attachment is the real size of the file to attach. the maximum time to download email attachment from UART. The unit is second. If it is default, the maximum time is infinite. The range is 1-48000. The unit is second. For the file in UFS or SD or RAM, this parameter is default. A numeric to indicate the result to input the attachment. If it is a negative numeric, it is the same as (Please refer to the chapter 3). If is not a negative numeric, it represents the real length of the attachment. l e t l c a e i t u n Q ide f n o C X Reference X Note: 1. "+++" is used to end downloading attachment 2. The total number of the attachments should be no more than 10. 3. The total size of the attachments should be not greater than 100 Kbytes. This restriction is only the attachments input from UART. 2.2.10. AT+QSMTPDATT Delete an attachment AT+QSMTPDATT Delete an attachment Test Command AT+QSMTPDA TT=? Response +QSMTPDATT: (1-10) OK Execute Command AT+QSMTPDA TT Response If format is right and it is not sending email, response OK +QSMTPDATT: Otherwise, response ERROR GSM_SMTP_ATC_V1.2 - 12 - GSM_SMTP_ATC_V1.2 Parameters See Write Command Write Command AT+QSMTPDA TT= Response If format is right and it is not sending email, response OK +QSMTPDATT: Otherwise, response ERROR Parameters l e t l c a e i t u n Q ide f n o C The index of the attachment to delete. Please refer to in 2.2.9 A numeric to indicate the result to delete the attachment. If it is 0, it means it is successful to delete the attachment. If it is a negative numeric, it is the same as (Please refer to the chapter 3). X X X Reference X Note: The Execute Command is used to delete all the attachments. 2.2.11. AT+QSMTPCLR Clear all the configurations and contents of the email AT+QSMTPCLR Clear all the configurations and contents of the email Test Command AT+QSMTPCL R=? Response OK Execute Command AT+QSMTPCL R If format is right, response OK Reference Note: The execute command will clear the following configurations and contents. 1. user name (refer to the command AT+QSMTPUSER) 2. password (refer to the command AT+QSMTPPWD) 3. the sender’s address (refer to the command AT+QSMTPADDR) 4. the sender’s name (refer to the command AT+QSMTPNAME) 5. the address of the SMTP server (refer to the command AT+QSMTPSRV) 6. all the recipients (refer to the command AT+QSMTPDST) 7. the subject (refer to the command AT+QSMTPSUB) 8. the body (refer to the command AT+QSMTPBODY) 9. all the attachments (refer to the command AT+QSMTPATT) Otherwise, response ERROR GSM_SMTP_ATC_V1.2 - 13 - GSM_SMTP_ATC_V1.2 2.2.12. AT+QSMTPCFG SMTP configurations AT+QSMTPCFG SMTP configurations Test Command AT+QSMTPCF G=? Response +QSMTPCFG: (1) OK Write Command Response AT+QSMTPCF If format is right and is omitted, response G= [, e>] OK Else If format is right and it is not sending email, response OK Otherwise, response ERROR l e t l c a e i t u n Q ide f n o C Parameters Reference A numeric to indicate the parameter to configure. 1 configure whether need authentication the value of the parameter to configure defined by . If == 1 0 don’t need authentication 1 need authentication. This is factory default value. Note: The Write Command with omitted is used to query the value of the corresponding parameter. 2.2.13. AT+QSMTPPUT Send email AT+QSMTPPUT Send email Test Command AT+QSMTPPU T=? Response +QSMTPPUT: (100-48000) OK Execute Command AT+QSMTPPU T If format is right and it is not sending email, response OK +QSMTPPUT: Otherwise, response ERROR Note: This means the module will try to send the email without time GSM_SMTP_ATC_V1.2 - 14 - GSM_SMTP_ATC_V1.2 restriction. Write Command AT+QSMTPPU T= Response If format is right and it is not sending email, response OK +QSMTPPUT: Otherwise, response ERROR Parameters the maximum time to send email. The unit is second. If it is default, the maximum time is infinite. The range is 100-48000. A numeric to indicate the result to send the email. If it is 0, it means it is successful to send the mail. If it is a negative numeric, it is the same as (Please refer to the chapter 3). l e t l c a e i t u n Q ide f n o C X X Reference GSM_SMTP_ATC_V1.2 - 15 - GSM_SMTP_ATC_V1.2 3. Summary of Error Codes The error code indicates an error related to mobile equipment or network. The detail about is described in the following table. Meaning -1 Unknown error -3 The SMTP service is busy. Such as, downloading body or attachment, sending email -4 l e t l c a e i t u n Q ide f n o C -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -421 -450 -451 -452 -500 -501 -502 -503 -504 -521 -530 -535 Failed to get IP address according to domain name Network error. Such as, failed to activate GPRS/CSD context, failed to establish the TCP connection with the SMTP server or failed to send email to the SMTP server, etc. Unsupported authentication type The connection for the SMTP service is closed by peer. GPRS/CSD context is deactivated Timeout No recipient for the SMTP service Failed to send email Failed to open file for attachment No enough memory for the attachment Failed to save the attachment The input parameter is wrong Service not available, closing transmission channel Requested mail action not taken: mailbox unavailable Requested action aborted: local error in processing Requested action not taken: insufficient system storage Syntax error, command unrecognized Syntax error in parameters or arguments Command not implemented Bad sequence of commands Command parameter not implemented does not accept mail (see rfc1846) Access denied Authentication failed -550 Requested action not taken: mailbox unavailable -551 User not local; please try -552 Requested mail action aborted: exceeded storage allocation -553 Requested action not taken: mailbox name not allowed -554 Transaction failed GSM_SMTP_ATC_V1.2 - 16 - GSM_SMTP_ATC_V1.2 4. Examples 4.1. Configure SMTP server AT+QSMTPSRV="smtp.163.com", 25 // Set SMTP server as "smtp.163.com" and port as 25 OK AT+QSMTPUSER="quectel" OK // Set the user name for authentication as "quectel" AT+QSMTPPWD="test" OK // Set the password for authentication as "test" l e t l c a e i t u n Q ide f n o C Note: Actually, the user name "quectel" and password "test" isn’t a valid account. It is just an example. 4.2. Configure the information of sender AT+QSMTPNAME="quectel" OK // Set the name of the sender as "quectel" AT+QSMTPADDR="quectel@163.com" // Set the email address of the sender as "quectel@163.com" OK 4.3. Add recipients AT+QSMTPDST=1,2,"colin.hu@quectel.com" OK +QSMTPDST: 0 // Add a recipient "colin.hu@quectel.com". And it is a copy receiver which is defined by 2. // Successfully add the recipient. By the way, if you find the recipient you added before is wrong and you want to delete it, please execute the following command. AT+QSMTPDST=0,2,"colin.hu@quectel.com" GSM_SMTP_ATC_V1.2 // Delete the recipient - 17 - GSM_SMTP_ATC_V1.2 "colin.hu@quectel.com" in the copy recipients list. OK +QSMTPDST: 0 // Successfully delete the recipient. 4.4. Edit the content of the email AT+QSMTPSUB=0,"SMTP TEST" OK // Set the title of the email as "SMTP TEST" AT+QSMTPBODY=1, 10 // Prepare to input the content of the email from UART. And the character set of the email body is UTF-8 which is defined by 1. OK l e t l c a e i t u n Q ide f n o C CONNECT …… +++ +QSMTPBODY: 2009 AT+QSMTPATT="bigfile.txt" OK CONNECT …… +++ +QSMTPATT: 20090 AT+QSMTPATT? +QSMTPATT: 1,"bigfile.txt", 20090 OK // Input the data of the email body // Input "+++" to end downloading email body // Successful to download email body and the size of the email body is 2009. // Prepare to download the attachment "bigfile.txt" // Input the data of the attachment // Input "+++" to end downloading the attachment // Successful to download the attachment and the size of the attachment is 20090. // Query the information of all attachments // The first attachment is "bigfile.txt" and its size is 20090. By the way, if you don’t want send the attachment with the email, please delete the attachment by the following command. AT+QSMTPDATT=1 OK // Delete the first attachment +QSMTPDATT: 0 // Successfully delete the attachment GSM_SMTP_ATC_V1.2 - 18 - GSM_SMTP_ATC_V1.2 4.5. Add a file in UFS as attachment It is supported to add a file in UFS as the attachment of the email. And the following is an example to add a file in UFS as the attachment. AT+QSMTPATT="/UFS/attach.txt" // Add the file "attach.txt" in UFS as attachment. OK +QSMTPATT: 20100 // Successful to add the file "attach.txt" in UFS as attachment and its size is 20100. AT+QSMTPATT? +QSMTPATT: 1,"bigfile.txt", 20090 // Query the information of all attachments // The first attachment is "bigfile.txt" and its size is 20090. +QSMTPATT: 2,"/UFS/attach.txt", 20100 // The second attachment is "attach.txt" in UFS and its size is 20100. OK l e t l c a e i t u n Q ide f n o C In M33, it is supported to add the files in SD and RAM. And the method to add the file in SD or RAM is almost the same as the method to add the file in UFS except replacing "/UFS/" with "/SD/" or "/RAM/". 4.6. Send email AT+QIFGCNT=0 OK AT+QICSGP=1,”CMNET” OK AT+QSMTPPUT=300 OK …… +QSMTPPUT:0 GSM_SMTP_ATC_V1.2 // Choose the context 0 to activate GPRS/CSD context for the SMTP service, please refer to [1] and [2] // Choose GPRS mode and set the APN as "CMNET" // Send the email to the SMTP server and the maximum time allowed to send email is 300 seconds. // Wait for a moment // Successfully send email. - 19 - Quectel Wireless Solutions Co., Ltd. Room 501, Building 9, No.99, Tianzhou Road, Shanghai, China 200233 Tel: +86 21 5108 2965 Mail: info@quectel.com H H
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Has XFA : No Language : zh-CN XMP Toolkit : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:08:04 Format : application/pdf Creator : Colin.Hu Create Date : 2015:04:08 15:12:52+08:00 Creator Tool : Microsoft® Word 2010 Modify Date : 2015:04:08 15:13:52+08:00 Metadata Date : 2015:04:08 15:13:52+08:00 Producer : Microsoft® Word 2010 Document ID : uuid:aee08202-12be-4416-9da8-e21a1fab1be9 Instance ID : uuid:73a0e73d-6a1e-457b-8bdf-8012f37eb634 Page Mode : UseOutlines Page Count : 21 Author : Colin.HuEXIF Metadata provided by EXIF.tools