direct SMTP connection?

27 thoughts on “direct SMTP connection?

  1. Hello,

     

    i use the GC864 Modul (10.00.xx3) and send emails with the AT command "#SMTPCL". It works fine.

     

    But there is a problem. How can I tell the SMTP server more than one Email recipientCan I connect directly to the SMTP server (smtp.web.de, port 25) somehow, to use the SMTP and MIME Protocoll? The SMTP and MIME protocoll don’t have the restriction like the AT-Email commands.

     

     

     

    "AT+CMEE=1rnrnOKrn"

    "AT+CPIN?rnrn+CPIN:
    SIM PINrnrnOK…"

    "AT+CPIN="0710"rnrnOKrn"

    "AT+CSQrnrn+CSQ:
    30,0rnrnOKrn"

    "AT#CIMIrnrn#CIMI:
    21407420014706…"

    "AT+CGDCONT=1,"IP","internetm2m.a…"

     

    "AT#ESMTP="mail.gmx.net"rnrnOKrn"

    "AT#EUSER="MONILOG_datalink@gmx.n…

    "AT#EPASSW="123456789"rrnOKrn"

    "AT#EADDR="MONILOG_datalink@gmx.n…

    "AT#ESAVrrnOKrn"

     

    "AT#SGACT=1,0rnrnOKrn"

    "AT#SGACT=1,1rrn#SGACT:
    10.1.38.1…"

     

    ???

     

     

    PDP context is successfull activated.

     

    Thank you for your anwers.

     

    Eric Hantke

    1. Telit IP Easy User Guide doc has examples for both SMTP client direct connection receive and send operations.

      1. Normal
        0

        21

        false
        false
        false

        DE
        X-NONE
        X-NONE

        MicrosoftInternetExplorer4

        I want send an Email with SSL. I use the following AT Commands.

         

        Send:    
                      
        AT+CMEE=1rn

        Response:          
        AT+CMEE=1rnrnOKrn

        Send:    
                      
        AT+CPIN?rn

        Response:          
        AT+CPIN?rrn+CPIN: SIM PINrnrnOKr…

        Send:    
                      
        AT+CPIN="0710"rn

        Response:          
        AT+CPIN="0710"rnrnOKrn
        Send:    
                      
        AT+CSQrn

        Response:          
        AT+CSQrnrn+CSQ: 31,0rnrnOKrn

        Send:    
                      
        AT#CIMIrn

        Response:          
        AT#CIMIrnrn#CIMI: 21407420014706…

        Send:    
                      
        AT+CGDCONT=1,"IP","internetm2m.air.com","0.0.0.0",0,0"
        rn

        Response:          
        AT+CGDCONT=1,"IP","internetm2m. air.com
        ,"0.0.0.0",0,0" rnrnOKrn

        Send:    
                      
        AT#SCFG=1,1,300,0,600,50rn

        Response:          
        AT#SCFG=1,1,300,0,600,50rnrnOKrnrn

        Send:    
                      
        AT#CPUMODE=2rn

        Response:          
        AT#CPUMODE=2rnrnOKrn

        Send:    
                      
        AT#SSLS=1rn

        Response:          
        AT#SSLS=1rnrn#SSLS: 1,1rnrnOKrn

        Send:    
                      
        AT#SSLH=1,0rn

        Response:          
        AT#SSLH=1,0rrnOKrn

        Send:    
                      
        AT#SSLEN=1,0rn

        Response:          
        AT#SSLEN=1,0rnrnOKrn

        Send:    
                      
        AT#SSLEN=1,1rn

        Response:          
        AT#SSLEN=1,1rnrnOKrn

        Send:    
                      
        AT#SGACT=1,0,"datalink","MONILOG"rn

        Response:          
        AT#SGACT=1,1,"datalink","MONILOG"rn#SGACT:
        10.14.9.50rnrnOKrn

        Send:    
                      
        AT#SSLD=1,587,mail.gmx.net,0,0,100rn

         

         

        Just I must wait for the response from the SMTP Server (-> “220”). I
        wait for 15 seconds, but I don’t get an answer.

        After that I would use the SMTP and MIME Protocol, to send the mail like
        the example.

         

        Is something wrong with my configurations?

  2. Thank you Cosmin. The command AT&K0 was not closed with "rn". The command have the response "OK".   But nothing changed, i dont get an answer from the smtp server.

     

    GMX is not an small Email provider, it should work. I checked the Port and the Server name again and again.  

     

    Have you a working example for Email with SSL?

     

    Eric

  3. I updateed
    my AT comand, which send to the modul.

     

    Send:    
                  
    AT&K0rn

    Response:          
    AT&K0rnrnOKrn

    Send:    
                  
    AT+CMEE=1rn

    Response:          
    AT+CMEE=1rnrnOKrn

    Send:    
                  
    AT+CPIN?rn

    Response:          
    AT+CPIN?rrn+CPIN: SIM PINrnrnOKr…

    Send:    
                  
    AT+CPIN="0710"rn

    Response:          
    AT+CPIN="0710"rnrnOKrn
    Send:    
                  
    AT+CSQrn

    Response:          
    AT+CSQrnrn+CSQ: 31,0rnrnOKrn

    Send:    
                  
    AT#CIMIrn

    Response:          
    AT#CIMIrnrn#CIMI: 21407420014706…

    Send:    
                  
    AT+CGDCONT=1,"IP","internetm2m.air.com","0.0.0.0",0,0"
    rn

    Response:          
    AT+CGDCONT=1,"IP","internetm2m. air.com
    ,"0.0.0.0",0,0" rnrnOKrn

    Send:    
                  
    AT#SCFG=1,1,300,0,600,50rn

    Response:          
    AT#SCFG=1,1,300,0,600,50rnrnOKrnrn

    Send:    
                  
    AT#CPUMODE=2rn

    Response:          
    AT#CPUMODE=2rnrnOKrn

    Send:    
                  
    AT#SSLS=1rn

    Response:          
    AT#SSLS=1rnrn#SSLS: 1,1rnrnOKrn

    Send:    
                  
    AT#SSLH=1,0rn

    Response:          
    AT#SSLH=1,0rrnOKrn

    Send:    
                  
    AT#SSLEN=1,0rn

    Response:          
    AT#SSLEN=1,0rnrnOKrn

    Send:    
                  
    AT#SSLEN=1,1rn

    Response:          
    AT#SSLEN=1,1rnrnOKrn

    Send:    
                  
    AT#SGACT=1,0,"datalink","MONILOG"rn

    Response:          
    AT#SGACT=1,1,"datalink","MONILOG"rn#SGACT:
    10.14.9.50rnrnOKrn

    Send:    
                  
    AT#SSLCFG=1,1,300,0,500,0rn

    Response:          
    AT#SSLCFG=1,1,300,0,500,0rnrnOKrn

    Send:    
                  
    AT#SSLSECCFG=1,0,0rn

    Response:         
    AT#SSLSECCFG=1,0,0rnrnOKrn

     

    Send:    
                  
    AT#SSLD=1,587,mail.gmx.net,0,0,100rn

    Response:          AT#SSLD=1,587,mail.gmx.net,0,0,100rnrn+CME ERROR:839rn

     

    -> SSL error during handshake

     

    What is wrong?

     

    Thank for your answer.

    Normal
    0

    21

    false
    false
    false

    DE
    X-NONE
    X-NONE

    1. Don’t use rn but r only.

      Try a maxTo different from in #SSLCFG.

      Try a higher Timeout in #SSLD.

      Maybe auth_mode 0 in SSLECCFG is not supported by the server?

      Are you sure about IP and port? Can you use a PC email client with these settings & SSL? 

  4. Hi,

     

    at the moment I am working on sending binary files as email attachment. For that I am using base64 encoding, so I am encoding my binary data with base64 algorithm before transmitting to the GPRS module. In addition I am inserting a rn every 76 Bytes into the encoded data stream for limiting the data line length. 

    Sending files of about 2KB size works fine. But for ‘huge’ files (I tested with a file size of about 50KB) there will be quite a big data loss. The received email attachment size is very random, sometimes I receive 45 KB but sometimes I only receive 13KB.

    I guessed that data transmission to the module could be to fast, so I am waiting 30ms every 3 Byte during transmission. With this condition the file is completely received, but the transmission is extremly slow. I took about 9 minutes to transmit the data.

     

    What are the limits when uploading data as an attachment? How much delay time is needed after transmitting a certain amount of data?

     

    Thank you 

  5. Hi,

     

    I
    am working on sending binary data files as email attachment at the
    moment. For that I am using base64 encoding, so I am encoding the binary
    data with base64 algorithm before transmitting it to the GPRS module
    (GC864-Quad V2). In addition I am inserting a rn every 76 Byte into
    the encoded data stream for limiting the data line size.

     

    But
    unfortunately not all of the data is received in the sent email. I
    tested with a file size of 50 KB. Sometimes I only receive 37KB,
    sometime I only receive 13 KB. The received data size is very random. 

     

    I
    guessed that data transmission to the module is too fast. So I inserted
    a 30ms delay every 3 Byte during data transmission. With this condition
    the data file was completely received. Thus data transmission was also
    extremly slow, it took about 9 minutes.

    That’s too slow, I want to transmit the file errorless as ‘fast’ as possible.

     

    What
    is  the maximum data rate I can achieve when uploading email
    attachments? How much delay time is necessary during transmission? 

     

    Thank you and best regards

  6. I tested unsuccessfully five modems (GC864-QUAD V2) to enable SSL with following AT commands

     

     AT+CPIN=xxxx

    OK
    AT+CGDCONT=1,”IP”,”xx.xx.xx”

    OK
    AT+CPIN?

    +CPIN: READY

    OK
    AT+COPS=1,0,”xx”

    OK
    AT+CREG=1

    OK
    AT#SCFG=1,1,300,90,600,50

    OK

    +CREG: 2
    AT#SGACTAUTH=0

    OK

    +CREG: 1
    AT#SGACT=1,1

    #SGACT: xx.xx.xx.xx

    OK
    at#sslen=1,1

    ERROR
    at#sslen=1,0

    ERROR

     

     

    What is my mistake?

        1. AT&V

           
          DTE SPEED                      : AUTO
          DTE FORMAT                     : AUTO
          GSM DATA MODE                  : Not Transparent
          AUTOBAUD                       : +IPR0=YES           
          COMMAND ECHO                   : E1=YES           
          RESULT MESSAGES                : Q0=YES           
          VERBOSE MESSAGES               : V1=YES           
          EXTENDED MESSAGES              : X1=YES           
          LINE SPEED                     : F0=autodetect    
          CONSTANT DTE SPEED             : YES           
          FLOW CONTROL OPTIONS           : &K3=HW bidirect.  
          ERROR CORRECTION MODE          : RLP           
          CTS (C106) OPTIONS             : &B2=OFF while disc.
          DSR (C107) OPTIONS             : &S3=PHONE ready->ON
          DTR (C108) OPTIONS             : &D0=ignored       
          DCD (C109) OPTIONS             : &C1=follows carrier
          RI (C125) OPTIONS              : R1=OFF dur. off-hk
          C108/1 OPERATION               : &D0=NO            
          POWER SAVING ON DTR            : +CFUN:1=NO            
          DEFAULT PROFILE                : &Y0=user profile 1

          OK
          AT+CGMR

          10.00.058

          OK
          AT+CPIN=x

          OK
          AT+CGDCONT=1,"IP","x","0.0.0.0",0,0

          OK
          AT+CPIN?

          +CPIN: READY

          OK
          AT+COPS=1,0,"x"

          OK
          AT+CREG=1

          OK

          +CREG: 1
          AT#SCFG=1,1,300,90,600,50

          OK
          AT#SGACTAUTH=0

          OK
          AT#SGACT=1,1

          #SGACT: x

          OK
          AT#SSLEN=1,1

          ERROR

           

           

          I am puzzled. Do you have an idea?

          1. After I reset the modem and start the AT sequence…

             

             

             

            AT+CMEE=2

            OK

             

            [the same as above]

             

            AT#SSLEN=1,1

            +CME ERROR: SSL already activated

             

             

             

            …the modem response is very interesting. Why is the SSL already activated after a reset?

             

            Terefore I should use “AT#SSLEN?”

             

            Thanks and regards,

             

            Erwin

             

          2. Note: these values are automatically saved in NVM.

            So the enabling should be made only once and is remembered.

          3. Now I’m stuck with:

             

             

            AT#SSLSECDATA=1,1,1

            +CME ERROR: operation not supported

             

             

            I want to store:

             

            —–BEGIN CERTIFICATE—–
            MIIBoTCCAQoCCQClih34IyYfXzANBgkqhkiG9w0BAQUFADAVMRMwEQYDVQQDEwpz
            bWFydHBsdWcyMB4XDTE0MDcyNDExNDU0MloXDTI0MDcyMTExNDU0MlowFTETMBEG
            A1UEAxMKc21hcnRwbHVnMjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAlVbg
            zCpllIpKskJbEqXUj5+MXmolHoDe823hYZLDrSNzMaoCHdQS01ZYJQyLVmOyQs+H
            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            Aa3dz6wGo+1rQL98fM0mBlWC7B9MnSPdyTaduyUCAwEAATANBgkqhkiG9w0BAQUF
            AAOBgQBHi6IL9YsZquvUahlXqO85w2zgOolOSDAa/UoeSbCk9LdOE+ph6Y9wH4uF
            q1zMYqwcZ7hFD5Rmsu6ExaiUwDkVJagvtE1eag49WFOGRbVb881Ymt3dKbsV3LiB
            eZ/eKMydE33miBvKwUH3K49KxWNlP2TMOoUZsKUybY5ZPqwsng==
            —–END CERTIFICATE—–
             

             

            Why is the operation not supported?

             

  7. Hello Cosmin,

     

    I cant store a cert. My results:

     

    AT#SSLSECDATA=1,1,1,1024

    > —–BEGIN CERTIFICATE—–MIIBoTCCAQoCCQClih34IyYfXzANBgkqhkiG9w0BAQUFADAVMRMwEQYDVQQDEwpzbWFydHBsdWcyMB4XDTE0MDcyNDExNDU0MloXDTI0MDcyMTExNDU0MlowFTETMBEGA1UEAxMKc21hcnRwbHVnMjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAlVbgzCpllIpKskJbEqXUj5+MXmolHoDe823hYZLDrSNzMaoCHdQS01ZYJQyLVmOyQs+Hfi5xc2G9URQHNaYNgfghc7+NrZnSSjTvRw46bZFihw7r+eBc6xThxZITwrj3zqSGAa3dz6wGo+1rQL98fM0mBlWC7B9MnSPdyTaduyUCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBHi6IL9YsZquvUahlXqO85w2zgOolOSDAaxUoeSbCk9LdOE+ph6Y9wH4uFq1zMYqwcZ7hFD5Rmsu6ExaiUwDkVJagvtE1eag49WFOGRbVb881Ymt3dKbsV3LiBeZxeKMydE33miBvKwUH3K49KxWNlP2TMOoUZsKUybY5ZPqwsng==—–END CERTIFICATE—–
    +CME ERROR: SSL certs and keys wrong or not stored

     

    AT#SSLSECDATA=1,1,1,1024

    > —–BEGIN CERTIFICATE—–
    MIIBoTCCAQoCCQClih34IyYfXzANBgkqhkiG9w0BAQUFADAVMRMwEQYDVQQDEwpz
    bWFydHBsdWcyMB4XDTE0MDcyNDExNDU0MloXDTI0MDcyMTExNDU0MlowFTETMBEG
    A1UEAxMKc21hcnRwbHVnMjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAlVbg
    zCpllIpKskJbEqXUj5+MXmolHoDe823hYZLDrSNzMaoCHdQS01ZYJQyLVmOyQs+H
    fi5xc2G9URQHNaYNgfghc7+NrZnSSjTvRw46bZFihw7r+eBc6xThxZITwrj3zqSG
    Aa3dz6wGo+1rQL98fM0mBlWC7B9MnSPdyTaduyUCAwEAATANBgkqhkiG9w0BAQUF
    AAOBgQBHi6IL9YsZquvUahlXqO85w2zgOolOSDAaxUoeSbCk9LdOE+ph6Y9wH4uF
    q1zMYqwcZ7hFD5Rmsu6ExaiUwDkVJagvtE1eag49WFOGRbVb881Ymt3dKbsV3LiB
    eZxeKMydE33miBvKwUH3K49KxWNlP2TMOoUZsKUybY5ZPqwsng==
    —–END CERTIFICATE—–

    +CME ERROR: SSL certs and keys wrong or not stored
     

     

    I tested it with LF, LF+CR, CR+LF and only CR line endings. No success.

     

    Thanks and regards,

    Erwin

      1. Hello  Cosmin,

         

        the cert  has 638 bytes.

         

         

        [… like above]

        OK
        AT#SSLSECCFG?

        #SSLSECCFG: 1,3,1

        OK
        AT#SSLEN?

        #SSLEN: 1,1

        OK
        AT#SSLSECDATA=1,1,1,638

        > —–BEGIN CERTIFICATE—–
        MIIBoTCCAQoCCQClih34IyYfXzANBgkqhkiG9w0BAQUFADAVMRMwEQYDVQQDEwpzbWFydHBsdWcyMB4XDTE0MDcyNDExNDU0MloXDTI0MDcyMTExNDU0MlowFTETMBEGA1UEAxMKc21hcnRwbHVnMjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAlVbgzCpllIpKskJbEqXUj5+MXmolHoDe823hYZLDrSNzMaoCHdQS01ZYJQyLVmOyQs+Hfi5xc2G9URQHNaYNgfghc7+NrZnSSjTvRw46bZFihw7r+eBc6xTh/ZITwrj3zqSGAa3dz6wGo+1rQL98fM0mBlWC7B9MnSPdyTaduyUCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBHi6IL9YsZquvUahlXqO85w2zgOolOSDAsdUoeSbCk9LdOE+ph6Y9wH4uFq1zMYqwcZ7hFD5Rmsu6ExaiUwDkVJagvtE1eag49WFOGRbVb881Ymt3dKbsV3LiBeZ/eKMydE33miBvKwUH3K49KxWNlP2TMOoUZsKUybY5ZPqwsng==—–END CERTIFICATE—–
        +CME ERROR: SSL certs and keys wrong or not stored

         

        Thanks and regards,

        Erwin

      2. Hello Cosmi,

         

        now I corrected the size. The size of the cert is 638 bytes.

         

        OK
        AT#SSLSECCFG?

        #SSLSECCFG: 1,3,1

        OK
        AT#SSLEN?

        #SSLEN: 1,1

        OK
        AT#SSLSECDATA=1,1,1,638

        > —–BEGIN CERTIFICATE—–
        MIIBoTCCAQoCCQClih34IyYfXzANBgkqhkiG9w0BAQUFADAVMRMwEQYDVQQDEwpzbWFydHBsdWcyMB4XDTE0MDcyNDExNDU0MloXDTI0MDcyMTExNDU0MlowFTETMBEGA1UEAxMKc21hcnRwbHVnMjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAlVbgzCpllIpKskJbEqXUj5+MXmolHoDe823hYZLDrSNzMaoCHdQS01ZYJQyLVmOyQs+Hfi5xc2G9URQHNaYNgfghc7+NrZnSSjTvRw46bZFihw7r+eBc6xTh/ZITwrj3zqSGAa3dz6wGo+1rQL98fM0mBlWC7B9MnSPdyTaduyUCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBHi6IL9YsZquvUahlXqO85w2zgOolOSDAsdUoeSbCk9LdOE+ph6Y9wH4uFq1zMYqwcZ7hFD5Rmsu6ExaiUwDkVJagvtE1eag49WFOGRbVb881Ymt3dKbsV3LiBeZ/eKMydE33miBvKwUH3K49KxWNlP2TMOoUZsKUybY5ZPqwsng==—–END CERTIFICATE—–
        +CME ERROR: SSL certs and keys wrong or not stored

         

        Thanks and regards,

        Erwin

  8. Hello Cosmi,

     

    I got it. My mistake was a wrong size. The size was correct for a cert with CR+LF line endings. Now I used the correct size for only LF line endings of 627 bytes.

     

     

    AT#SSLSECCFG=1,3,1

    OK
    AT#SSLSECCFG?

    #SSLSECCFG: 1,3,1

    OK
    AT#SSLEN?

    #SSLEN: 1,1

    OK
    AT#SSLSECDATA=1,1,1,627

    > —–BEGIN CERTIFICATE—–MIIBoTCCAQoCCQClih34IyYfXzANBtkqhkiG9w0BAeUFADAVMRMwEQYDVQQDEwpzbWFydHBsdWcyMB4XDTE0MDcyNDExNDU0MloXDTI0MDcyMTExNDU0MlowFTETMBEGA1UEAxMKc21hcnRwbHVnMjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAlVbgzCpllIpKskJbEqXUj5+MXmolHoDe823hYZLDrSNzMaoCHdQS01ZYJQyLVmOyQs+Hfi5xc2G9URQHNaYNgfghc7+NrZnSSjTvRw46bZFihw7r+eBc6xTh/ZITwrj3zqSGAa3dz6wGo+1rQL98fM0mBlWC7B9MnSPdyTaduyUCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBHi6IL9YsZquvUahlXqO85w2zgOolOSDAa/UoeSbCk9LdOE+pg6Y9wH4uFq1zhYqwcZ7hFD5Rmsu6ExaiUwDkVJagvtE1eag49WFOGRbVb881Ymt3dKbsV3LiBeZ/eKMydE33miBvKwUH3K49KxWNlP2TMOoUZsKUybY5ZPqwsng==—–END CERTIFICATE—–
    OK

     

    Simplest way to get the correct size:

    1. Export cert
    2. Check for correct line endings (only LF)
    3. Open cert and count the characters
    4. Use the count result as size

    Thanks and regards,

    Erwin