connection failed error during email sending

11 thoughts on “connection failed error during email sending

  1. Dear Sir,

    We are using GL868-DUAL (10.01.181) module to send email from Gmail server. Previously everything was working fine but now we are not now able to send email using Gmail/ other server server.

    Please find below log for your reference.

    15:03:38.870 [TX] – AT+CREG?
    15:03:38.914 [RX] –
    +CREG: 0,5

    OK
    15:03:42.094 [TX] – AT+CGDCONT=1,”IP”,”internet”
    15:03:42.191 [RX] –
    OK
    15:03:46.913 [TX] – AT+CSQ
    15:03:46.937 [RX] –
    +CSQ: 31,0

    OK
    15:03:48.050 [TX] – AT#SMTPCFG=1,587
    15:03:48.104 [RX] –
    OK
    15:03:52.016 [TX] – AT#ESMTP=”smtp.gmail.com”
    15:03:52.083 [RX] –
    OK
    15:03:53.198 [TX] – AT#EUSER=”telitmailbox@gmail.com”
    15:03:53.266 [RX] –
    OK
    15:03:54.557 [TX] – AT#EPASSW=”xxxxxxx”
    15:03:54.624 [RX] –
    OK
    15:03:55.409 [TX] – AT#ESAV
    15:03:55.456 [RX] –
    OK
    15:03:57.978 [TX] – AT#SGACT=1,1
    15:03:58.556 [RX] –
    #SGACT: 10.56.172.50

    OK
    15:04:00.326 [TX] – AT#EADDR=”telitmailbox@gmail.com”
    15:04:00.426 [RX] –
    OK
    15:04:02.060 [TX] – AT#EMAILD=”rd@xxxxx.in”,”Test_Mail”
    15:04:02.142 [RX] –
    > 15:04:04.650 [TX] – The standard format for an e-mail is laid down 15:04:09.403 [TX] – 15:04:25.328 [RX] –
    +CME ERROR: connection failed

    Please let us know, what is the issue.

    Thanks,

    Diwakar Singh

  2. Dear Sir,

    I am able to open TCP/IP socket. but could not send email.

    Please refer below log.

    AT#SGACT=1,0
    OK
    AT#SGACT=1,1

    #SGACT: 106.223.42.122

    OK
    AT#SD=1,0,587,”smtp.gmail.com”,0,0,1

    OK

    SRING: 1
    AT#SRECV=1,200
    #SRECV: 1,53
    220 smtp.gmail.com ESMTP o18sm5964150pgn.36 – gsmtp

    OK

    Please let us know what is the issue.

    Thanks,

      1. Dear Sir,

        I have updated Gmail certificate in the module but the issue still could not resolved. 

        Please find attached certificate for your reference. 

         

        16:08:53.101 [TX] – AT
        16:08:53.118 [RX] –
        OK
        16:08:53.664 [TX] – ATE0
        16:08:53.677 [RX] –
        OK
        16:08:54.390 [TX] – AT+CMEE=2
        16:08:54.412 [RX] –
        OK
        16:08:54.972 [TX] – AT#SLED=2
        16:08:55.003 [RX] –
        OK
        16:08:55.575 [TX] – AT#QSS?
        16:08:55.594 [RX] –
        #QSS: 0,1

        OK
        16:08:56.388 [TX] – AT+CMGF=1
        16:08:56.425 [RX] –
        OK
        16:08:56.995 [TX] – AT+CNMI=2,1,0,0,0
        16:08:57.048 [RX] –
        OK
        16:08:57.839 [TX] – AT+CSMP=17,11,0,0
        16:08:57.879 [RX] –
        OK
        16:08:58.452 [TX] – AT#SPN
        16:08:58.502 [RX] –
        #SPN: airtel

        OK
        16:08:59.217 [TX] – AT+CREG?
        16:08:59.253 [RX] –
        +CREG: 0,1

        OK
        16:08:59.826 [TX] – AT+CGREG?
        16:08:59.860 [RX] –
        +CGREG: 0,1

        OK
        16:09:01.140 [TX] – AT+CGDCONT=1,”IP”,”airtelgprs.com”
        16:09:01.218 [RX] –
        OK
        16:09:01.796 [TX] – AT+CSQ
        16:09:01.825 [RX] –
        +CSQ: 31,0

        OK
        16:09:02.908 [TX] – AT#SMTPCFG=1,587
        16:09:02.976 [RX] –
        OK
        16:09:05.160 [TX] – AT#ESMTP=”smtp.gmail.com”
        16:09:05.228 [RX] –
        OK
        16:09:06.544 [TX] – AT#EUSER=”telitmailbox@gmail.com”
        16:09:06.618 [RX] –
        OK
        16:09:08.766 [TX] – AT#EPASSW=”xxxxxxx”
        16:09:08.839 [RX] –
        OK
        16:09:10.782 [TX] – AT#EADDR=”telitmailbox@gmail.com”
        16:09:10.852 [RX] –
        OK
        16:09:12.412 [TX] – AT#SEMAIL=”telitmailbox@gmail.com”,”Test_Mail”
        16:09:12.777 [RX] –
        > 16:09:14.408 [TX] – hello 16:09:16.254 [TX] – 16:09:20.606 [RX] –
        +CME ERROR: connection failed

        Thanks,

        1. The certificate that you have used is not a Root CA certificate. attached the correct certificate for Google?s servers.
          For test purposes you can also disable certificate validation with ?AT#SSLSECCFG=1,0,0?.
          Then, to determine if you are using the correct CA certificate or not, enable it (AT#SSLSECCFG=1,0,1) and test the connection again.

          Then, since this is a 2G module, according to our SSL/TLS user guide, you should have increased the CPU speed. Please set AT#CPUMODE=3,
          before you start sending your email.

          Your issue may also be related to a Gmail security policy, this article describes the issue:                 https://support.google.com/accounts/answer/6010255?hl=en

          1. Dear Sir,

            I followed your suggestion but the issue could not be resolved. 

            Please find below log.

            OK
            AT+CGSN
            356308040021161

            OK
            AT#CIMI
            #CIMI: 404100606209588

            OK
            AT+CCID
            +CCID: 8991101506062095886

            OK
            AT+CGMI
            Telit

            OK
            AT+CGMM
            GL868-DUAL

            OK
            AT+CGMR
            10.01.181

            OK
            AT+CMAR=00000000

            OK
            AT#SSLSECCFG=1,0,0
            ERROR
            AT+CMEE+2
            ERROR
            AT+CMEE=2
            OK
            AT#SSLSECDATA=1,1,1,1162
            +CME ERROR: SSL not activated
            AT#SSLEN=1,1
            OK
            AT#SSLSECCFG=1,0,0
            OK
            AT#SSLSECDATA=1,1,1,1162

            > —–BEGIN CERTIFICATE—–
            MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV
            UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy
            dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1
            MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx
            dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B
            AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f
            BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A
            cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC
            AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ
            MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm
            aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw
            ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj
            IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF
            MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA
            A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y
            7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh
            1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4
            —–END CERTIFICATE—–

            OK
            AT#SLED=2
            OK
            AT#CPUMODE=3
            OK
            AT#SSLSECCFG=1,0,1
            OK
            AT#SPN
            #SPN: airtel

            OK
            AT+CGDCONT=1,”IP”,”airtelgprs.com”
            OK
            AT+CREG?
            +CREG: 0,1

            OK
            AT+CGREG?
            +CGREG: 0,1

            OK
            AT#SMTPCFG=1,587
            +CME ERROR: operation not allowed
            AT#SSLEN=1,0
            OK
            AT#SMTPCFG=1,587
            OK
            AT#ESMTP=”smtp.gmail.com”
            OK
            AT#EUSER=”telitmailbox@gmail.com”
            OK
            AT#EPASSW=”Diwakar_telit”
            OK
            AT#EADDR=”telitmailbox@gmail.com”
            OK
            AT+CREG?
            +CREG: 0,2

            OK
            AT+CREG?
            +CREG: 0,1

            OK
            AT+CGREG?
            +CGREG: 0,1

            OK
            AT#SMTPCFG?
            #SMTPCFG: 1,587,0,0,0,0

            OK
            AT#SEMAIL=”telitmailbox@gmail.com”,”Test_Mail”
            > hello dear
            ERROR
            at+cmee=2
            OK
            AT#SMTPCFG=1,587
            OK
            AT#ESMTP=”smtp.gmail.com”
            OK
            AT#EUSER=”telitmailbox@gmail.com”
            OK
            AT#EPASSW=”Diwakar_telit”
            OK
            AT#EADDR=”telitmailbox@gmail.com”
            OK
            AT#SEMAIL=”telitmailbox@gmail.com”,”Test_Mail”
            > hello dear1
            +CME ERROR: connection failed
            AT#SSLSECCFG?
            #SSLSECCFG: 1,0,1

            OK
            AT#SSLSECCFG=1,0,0
            OK
            AT#SMTPCFG=1,587
            OK
            AT#ESMTP=”smtp.gmail.com”
            OK
            AT#EUSER=”telitmailbox@gmail.com”
            OK
            AT#EPASSW=”xxxxxxx”
            OK
            AT#EADDR=”telitmailbox@gmail.com”
            OK
            AT#SEMAIL=”telitmailbox@gmail.com”,”Test_Mail”
            > hello dear2
            +CME ERROR: can not resolve DN
            AT#SSLSECCFG=1,0,0
            OK
            AT#SMTPCFG=1,587
            OK
            AT#ESMTP=”smtp.gmail.com”
            OK
            AT#EUSER=”telitmailbox@gmail.com”
            OK
            AT#EPASSW=”Diwakar_telit”
            OK
            AT#EADDR=”telitmailbox@gmail.com”
            OK
            AT#SEMAIL=”telitmailbox@gmail.com”,”Test_Mail”
            > hello dear 3
            +CME ERROR: connection failed
            AT#EADDR=”telitmailbox@gmail.com”
            OK
            AT#SEMAIL=”telitmailbox@gmail.com”,”Test_Mail”
            >
            +CME ERROR: connection failed

            Thanks,

            Diwakar

          2. Can you check with AT#EMAILMSG, what kind of SMTP error message did you received fromn the server after AT#SEMAIL…?

          3. 16:04:59.079 [TX] – AT
            16:04:59.108 [RX] –
            OK
            16:04:59.639 [TX] – ATE0
            16:04:59.667 [RX] –
            OK
            16:05:00.169 [TX] – AT#CPUMODE=3
            16:05:00.194 [RX] –
            OK
            16:05:00.729 [TX] – AT+CMEE=2
            16:05:00.754 [RX] –
            OK
            16:05:01.292 [TX] – AT#SLED=2
            16:05:01.329 [RX] –
            OK
            16:05:01.874 [TX] – AT#QSS?
            16:05:01.904 [RX] –
            #QSS: 0,1

            OK
            16:05:02.445 [TX] – AT+CMGF=1
            16:05:02.463 [RX] –
            OK
            16:05:03.024 [TX] – AT+CNMI=2,1,0,0,0
            16:05:03.054 [RX] –
            OK
            16:05:03.581 [TX] – AT+CSMP=17,11,0,0
            16:05:03.614 [RX] –
            OK
            16:05:04.144 [TX] – AT#SPN
            16:05:04.189 [RX] –
            #SPN: airtel

            OK
            16:05:04.727 [TX] – AT+CREG?
            16:05:04.748 [RX] –
            +CREG: 0,1

            OK
            16:05:05.303 [TX] – AT+CGREG?
            16:05:05.339 [RX] –
            +CGREG: 0,1

            OK
            16:05:05.855 [TX] – AT+CGDCONT=1,”IP”,”airtelgprs.com”
            16:05:05.914 [RX] –
            OK
            16:05:06.436 [TX] – AT#SSLSECCFG=1,0,1
            16:05:06.474 [RX] –
            OK
            16:05:07.025 [TX] – AT+CSQ
            16:05:07.049 [RX] –
            +CSQ: 31,0

            OK
            16:05:07.596 [TX] – AT#SMTPCFG=1,587
            16:05:07.640 [RX] –
            OK
            16:05:08.487 [TX] – AT#ESMTP=”smtp.gmail.com”
            16:05:08.535 [RX] –
            OK
            16:05:09.060 [TX] – AT#EUSER=”telitmailbox@gmail.com”
            16:05:09.110 [RX] –
            OK
            16:05:10.265 [TX] – AT#EPASSW=”Diwakar_telit”
            16:05:10.308 [RX] –
            OK
            16:05:10.897 [TX] – AT#ESAV
            16:05:10.932 [RX] –
            OK
            16:05:12.245 [TX] – AT#EADDR=”telitmailbox@gmail.com”
            16:05:12.306 [RX] –
            OK
            16:05:12.977 [TX] – AT#SEMAIL=”telitmailbox@gmail.com”,”Test_Mail”
            16:05:13.288 [RX] –
            > 16:05:13.914 [TX] – hello 16:05:15.815 [TX] – 16:05:28.999 [RX] –
            +CME ERROR: connection failed
            16:05:30.089 [TX] – AT#EMAILMSG
            16:05:30.118 [RX] –
            #EMAILMSG: 534 5.7.14 https://support.google.com/mail/answer/78754 b75sm10617569pfb.90 –

            OK

          4. 16:04:59.079 [TX] – AT
            16:04:59.108 [RX] –
            OK
            16:04:59.639 [TX] – ATE0
            16:04:59.667 [RX] –
            OK
            16:05:00.169 [TX] – AT#CPUMODE=3
            16:05:00.194 [RX] –
            OK
            16:05:00.729 [TX] – AT+CMEE=2
            16:05:00.754 [RX] –
            OK
            16:05:01.292 [TX] – AT#SLED=2
            16:05:01.329 [RX] –
            OK
            16:05:01.874 [TX] – AT#QSS?
            16:05:01.904 [RX] –
            #QSS: 0,1

            OK
            16:05:02.445 [TX] – AT+CMGF=1
            16:05:02.463 [RX] –
            OK
            16:05:03.024 [TX] – AT+CNMI=2,1,0,0,0
            16:05:03.054 [RX] –
            OK
            16:05:03.581 [TX] – AT+CSMP=17,11,0,0
            16:05:03.614 [RX] –
            OK
            16:05:04.144 [TX] – AT#SPN
            16:05:04.189 [RX] –
            #SPN: airtel

            OK
            16:05:04.727 [TX] – AT+CREG?
            16:05:04.748 [RX] –
            +CREG: 0,1

            OK
            16:05:05.303 [TX] – AT+CGREG?
            16:05:05.339 [RX] –
            +CGREG: 0,1

            OK
            16:05:05.855 [TX] – AT+CGDCONT=1,”IP”,”airtelgprs.com”
            16:05:05.914 [RX] –
            OK
            16:05:06.436 [TX] – AT#SSLSECCFG=1,0,1
            16:05:06.474 [RX] –
            OK
            16:05:07.025 [TX] – AT+CSQ
            16:05:07.049 [RX] –
            +CSQ: 31,0

            OK
            16:05:07.596 [TX] – AT#SMTPCFG=1,587
            16:05:07.640 [RX] –
            OK
            16:05:08.487 [TX] – AT#ESMTP=”smtp.gmail.com”
            16:05:08.535 [RX] –
            OK
            16:05:09.060 [TX] – AT#EUSER=”telitmailbox@gmail.com”
            16:05:09.110 [RX] –
            OK
            16:05:10.265 [TX] – AT#EPASSW=”Diwakar_telit”
            16:05:10.308 [RX] –
            OK
            16:05:10.897 [TX] – AT#ESAV
            16:05:10.932 [RX] –
            OK
            16:05:12.245 [TX] – AT#EADDR=”telitmailbox@gmail.com”
            16:05:12.306 [RX] –
            OK
            16:05:12.977 [TX] – AT#SEMAIL=”telitmailbox@gmail.com”,”Test_Mail”
            16:05:13.288 [RX] –
            > 16:05:13.914 [TX] – hello 16:05:15.815 [TX] – 16:05:28.999 [RX] –
            +CME ERROR: connection failed
            16:05:30.089 [TX] – AT#EMAILMSG
            16:05:30.118 [RX] –
            #EMAILMSG: 534 5.7.14 https://support.google.com/mail/answer/78754 b75sm10617569pfb.90 –

            OK

            Dear Sir,

            Thanks for your support. The issue is resolved.

            I have enabled less security feature in my Gmail account. 

            Thanks,
            Diwakar