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.


  • AT#SMTPCL=\"[email protected]\",\"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.

  • \$\begingroup\$ 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... \$\endgroup\$
    – brhans
    Commented Aug 11, 2016 at 15:21
  • \$\begingroup\$ 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 \$\endgroup\$ Commented Aug 11, 2016 at 15:27
  • \$\begingroup\$ What is the return status from the command? \$\endgroup\$
    – Eugene Sh.
    Commented Aug 11, 2016 at 15:29
  • \$\begingroup\$ 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? \$\endgroup\$
    – brhans
    Commented Aug 11, 2016 at 15:29
  • \$\begingroup\$ 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. \$\endgroup\$ Commented Aug 11, 2016 at 15:32

1 Answer 1


According to the manual, section Send mail with attachment - #SMTPCL:


This command permits to send an email with different types of attachments if GPRS context has already been activated (#SGACT or #GPRS). After sending message body text (as with #EMAILD), the command switch to online mode if attachment has to be sent. While in online mode data received on the serial port are transmitted on the SMTP socket as MIME attachment. The escape sequence has to be sent to close the SMTP connection

In other words, YOU are responsible for sending the content of the attached file, after you send the body of the email message.

  • \$\begingroup\$ Thank you form making the documentation clearer. But how to send the content ? of a text file maybe open it and send the text, for a picture ? Open the picture in Binary Read and send its content ?! \$\endgroup\$ Commented Aug 11, 2016 at 15:46
  • \$\begingroup\$ It says "as MIME attachment"' so I would expect you open the file and encode it as MIME yourself. \$\endgroup\$
    – user16324
    Commented Aug 11, 2016 at 16:43
  • \$\begingroup\$ Thank you ! Though it is not hard, but your response helped me concentrate ! I just send text (or binary data) without setting MIME headers since these are set by the AT command options (e.g. AT#SMTPCL) ! 1- Send AT Command 2- Send Mail text body 3- Just send content of the attachment (think online mode) 4- send escape sequence "+++" \$\endgroup\$ Commented Aug 11, 2016 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.