NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
CC3100 Email Demo Application
Contents
Overview and application details[edit]
This sample application demonstrates how CC3100 can be used to send an email over SMTP. The application configures CC3100 to connect w/ an SMTP server and sends email to it. SMTP server forwards it to the recipient's email-server and the recipient receives the email from his email-server using IMAP/POP3 and/or other proprietary protocol.
Note: This wiki page is only applicable for CC3100-SDK v1.0.0 and upward releases. For documentation on older SDKs' examples, refer corresponding file in <cc3100-sdk-installation-location>\cc3100-sdk\docs\examples\
Email application's sequence[edit]
- Client first makes a TCP connection with SMTP server.
- SMTP server replies back w/ response-code and greeting-message containing FQDN
- HELO/EHLO – Client sends Hello Message to the server. ESMTP accepts EHLO
- The SMTP server replies with Code 250 and Hello Message. ESMTP Server replies with SMTP extensions it supports such as Email maximum Size, authentication etc.
- If SMTP server requires authentication, the client sends “auth login” followed by “Username” and “Password” encoded with proper encryption accepted by SMTP Server.
- auth login
- 334 VXNlcm5hbWU6
- Client sends "Username" encoded with proper encryption accepted by SMTP server
- a2F1c2hmmdmdmdmhbGt1a2thckBnhfjdhfdjjsksbWFpbC5jb20
- Client sends "Password" encoded with proper encryption accepted by SMTP Server
- 334 UGFzc3dvcmQ6
- Mlklkdldldl21haWxhYjskjdkskjss2Mzc3M=
- SMTP server replies with Authentication Success/Failure.
- 535 Incorrect authentication data/ 235 Authentication Successful
- SMTP client then sends From-Address
- MAIL FROM: xyz@abc.com
- SMTP client sends To-Address
- RCPT TO: abc@ti.com
- SMTP client sends DATA command
- DATA
- SMTP client sends email data.
- SMTP server responds with the acknowledgement
Source Files briefly explained[edit]
- main - Initializes the device, connects to an access-point and configures the email
- email - Wrapper functions to connect to SMTP-Server and send the configured email. These functions are called from main
- base64 - Functions to convert the raw bytes in quasi-big-endian order to Base64 string
Usage[edit]
Prerequisite: This application requires an access-point with internet connectivity
- Connect the board to a Windows-PC and configure the terminal-program for seeing the logs - CC3100 & CC3200 Terminal Setting has detailed instructions for configuring the terminal-program
- Open sl_common.h and change SSID_NAME, SEC_TYPE and PASSKEY as per your access-point properties - SimpleLink device will connect to this AP when the application is executed
- Open config.h and change values for USER and PASS for setting up the source email.
- Edit the same file and change values for DESTINATION_EMAIL, EMAIL_SUBJECT and EMAIL_MESSAGE for setting up the email properties
- Compile and run the application
- See the self explanatory logs on the terminal-program's console. On success, below message will be displayed on the terminal and an email is sent to the destination email-ID
Note: User may need to turn on the access for the less secure apps from the Google account settings to run this example.
Limitations/Known Issues[edit]
- The size of the message is currently 64.
- Subject should be less that 30 characters
- Destination email should be less that 30 characters.
- For this example users must alter the default Gmail security settings to a lower security level. If this modification is not made, the server will reject the sending action.
Links[edit]
{{#invoke: Navbox | navbox }} {{#invoke: Navbox | navbox }}