MIME attachments

  • Q: Type of module? A: gm862
    Q: Firmware version? A: latest
    Q: Type of starter kit you have?
    (S1, S1B, S2, S3, S4, EVK1, EVK2, none, other)


    I have sent a 'simple' MIME email with no problems using your examples.


    I am having trouble sending an attachment. I send the serial commands below, and the remote mail server responds correctly at every stage and sends the email.


    When I receive the email the attachment file is created ok, but there is no text in either the body or the attachment.


    Any ideas please?


    rgds
    mb




    command = "From:<XXXXX@orange.net>"
    command = "To:<XXXXXXX@btinternet.com>"


    command = "MIME-Version: 1.0"


    command = "Content-Type: multipart/mixed;" + "boundary=" + Chr(34) + "XXXXboundarytext" + Chr(34)


    ‘ This is the body text
    command = "--XXXXboundarytext"
    command = "Content-Type: text/plain;"
    command = " charset=" + Chr(34) + "iso-8859-1" + Chr(34)
    command = "Content-Transfer-Encoding: 7bit"

    command = "This is the BODY text message"


    ' This is the attachment file test.txt
    command = "--XXXXboundarytext"
    command = "Content-Type: text/plain; "
    command = " charset=" + Chr(34) + "iso-8859-1" + Chr(34)
    command = "Content-Transfer-Encoding: 7bit"
    command = "Content-Disposition: attachment;" + "filename=" + Chr(34) + "test.txt" + Chr(34)
    command = "This is the ATTACHMENT text"
    command = "--XXXXboundarytext--"


    'end with crlf, . ,crlf
    Command= (vbCr + vbLf + "." + vbCr + vbLf)

  • How do you try to send it? Via GPRS or via SMTP?


    NOTE:emails with a size above 1000 bytes must be send with your own SMTP protocol. The module does'nt support this.

  • My goal is to send a MIME image attachment (8kb binary file). I assume I would need Base64 encoding. I decided to start with just a text file attachment of just a few bytes.


    I'm working directly to the SMTP server. I thought I could send data via the serial port to the server - perhaps I'm getting confused ( that happens a lot!)


    rgds


    mb

  • For that you need as I mentioned your own SMTP protocol. The module support this!
    Have you implemented it?
    How do you establish your connection to the server?
    How is the setting from your flow control?

  • I thought I could login to the SMTP server and then send a MIME email with a Base64 encoded attached file. I can get my micro to encode to Base64.


    I dont therefore need my own protocol - or have I misundrstood?


    I login to the SMTP server with:
    command = "AT#SKTD=" + "0,25," + Chr(34) + "smtp.orange.net" + Chr(34) + ",0"
    command = "HELO orange.net"
    command = "RCPT TO: <xxxxx@btinternet.com>"
    command = "MAIL FROM: <xxxxxx@orange.net>"
    command = "DATA"


    MIME 1.0
    etc ..... refer to my previous post


    My flow control is Xon Xoff. I have tested this using FTP and it transfers large files without fault.


    ..... sorry for silly questions and your patience is very much appreciated, Wilhelm.


    rgds


    mb

  • I have got #EMAILD working to give a known working foundation and check that all the ISP / SMTP logins are ok - this function works fine.


    I have now tried to send just an email as a test setting attachment=0
    ie AT#SMTPCL = "xx@xx","test",0 and I get an immediate ERROR.


    I have double checked for silly mistakes - any thoughts please?


    rgds


    mb

  • Please find attached code. Each routine is triggered by a Visual Basic button; so I can check response from Telit as I proceed. Chr(34) is a quote and Chr(26) is ctrl Z.


    Thanks



    ‘ Setup
    command = "AT"
    command = "AT&K2" 'XON/XOFFFLOW CONTROL
    command = "AT+CGDCONT=" + " 1," + Chr(34) + "IP" + Chr(34) + "," + Chr(34) + "orangeinternet" + Chr(34) ‘ Context


    ‘ SMTP login
    command = "AT#ESMTP=" + Chr(34) + "smtp.orange.net" + Chr(34) '
    command = "AT#EUSER=" + Chr(34) + "xxxx@orange.net" + Chr(34)
    command = "AT#EPASSW=" + Chr(34) + "xxxxx" + Chr(34)
    command = "AT#EADDR=" + Chr(34) + "xxxxx@orange.net" + Chr(34)
    command = "AT#ESAV"


    ‘ Activate
    command = "AT#SGACT=1,1," + Chr(34) + "IPEASY" + Chr(34) + "," + Chr(34) + "IPEASY" + Chr(34)


    ‘ Send an email
    command = "AT#SMTPCL=" + Chr(34) + "m.boyden@btinternet.com" + Chr(34) + "," + Chr(34) + "Text test" + Chr(34) + ",0" '


    ‘ A text string
    command = "Hello from Telit Module" 'some text
    send_command()


    ‘ Send ctrl Z
    command = Chr(26) 'ctrl z
    send_command()

  • I'm not sure I understand - the previously attached code contains all my AT commands used to get this function going.


    I have removed authentication for security reasons - or have I misunderstood something?.


    rgds


    mb

  • OK I will try to explain how I interpret your commands:


    you post me this:

    Quote

    command = "AT+CGDCONT=" + " 1," + Chr(34) + "IP" + Chr(34) + "," + Chr(34) + "orangeinternet" + Chr(34) ‘ Context


    The right command looks like this:
    AT+CGDCONT=1,"IP","internet","0.0.0.0",0,0<cr>


    Chr(34) => "


    If I understand right your command looks like this:
    AT+CGDCONT="" 1,""" + "IP""","""orangeinternet


    You agree?

  • Ok - I understand - Visual Basic is confusing.


    My code is:
    command = "AT+CGDCONT=" + " 1," + Chr(34) + "IP" + Chr(34) + "," + Chr(34) + "orangeinternet" + Chr(34) ‘ Context


    The above code will send:


    "AT+CGDCONT=" will send AT+CGDCONT=


    "1," will send 1,


    Chr(34) will send "


    "IP" will send IP


    Chr(34) will send "


    "," will send ,



    etc .......


    You are correct - my command does not contain the full instruction - (I sent an older version). This is my full command:


    command = "AT+CGDCONT=" + " 1," + Chr(34) + "IP" + Chr(34) + "," + Chr(34) + "orangeinternet" + Chr(34) + "," + Chr(34) + "0.0.0.0" + Chr(34) + ",0,0"



    mike

  • I reconstruct it and it works as expected. For further analysis please be so and post me your complete AT command list (just the commands, not the syntax in visual basic)
    Thank you.