# AT-Commands: Send E-mail with attachment

I purchased a telit GSM Click (GL865) to use in my project. The architecture is composed of PIC based board with two MikroBUS connectors, I used one for the Telit GSM click, and the second one for the SD card.

I interfaced the Telit GSM Click correctly. I interfaced the SD card correctly.

I can read and write files to the SD card from within the Pic. I issue successfully the AT commands to Send SMS and to Send E-mails.

The goal: Send e-mail with attachment, via telit GSM CLIK GL865.

The problem: I can't send e-mail with attached file. I tried to provide filename to the command, it works without Error, but the received e-mail does not contain the file sent by the Telit modem, in contrast, I get an empty file with the same filename.

Example:

• AT#SMTPCL=\"myaddress@mymail.com\",\"testEmail\",1,\"test.txt\",0
• then I issue my text (email body)
• then I issue the escape sequence ("+++")

Where: test.txt is a text file (containing some text) and stored in the SD card.

The command above works fine, I receive the e-mail (containing email body text) with an empty file "test.txt"

I think that the AT Command fails in finding the file, then it will send an empty file with the same filename.

I think that there is a way to import the file to be used by the Telit modem and the AT commands.

I read the official Telit documentation and searched in the Internet, but I did not find any solution. I would like to seek your valuable support, and tell me please, how to get it to work, I will be very thankful.

• I'm unclear on how your SD card is connected to the GSM device. How are you expecting that the GSM device should read files from the SD card? Maybe some sort of block diagram would help... – brhans Aug 11 '16 at 15:21
• Thank you @brhans , the SD card is connected to the MikroBus connector, and interfaced with Pic on SPI mode. dropbox.com/s/aasi52n55f72di0/ex8MikroBus.jpg?dl=0 – Yahya Yahyaoui Aug 11 '16 at 15:27
• What is the return status from the command? – Eugene Sh. Aug 11 '16 at 15:29
• That photo doesn't make your setup much clearer. Draw a block diagram of you you have things connected. Is the SD card directly connected to the GSM device or are both the GSM and SD Card individually connected to your PIC board? – brhans Aug 11 '16 at 15:29
• I am sorry, in fact, I can't make a block diagram, the project is of my friend, he doesn't have a Stack-Profile, so it is me who posts his question... long story short; The thing is both the GSM and SD Card are individually connected to the PIC board, we don't know how to import the file to be seen by the GSM module. Thanks. – Yahya Yahyaoui Aug 11 '16 at 15:32

AT#SMTPCL=<da>,<subj>,<att>[,<filename>,<encod>]