AT#SMTPCFG Error

16 thoughts on “AT#SMTPCFG Error

  1. Dear,

     

    When we tried to change the SMTP SSL settings with AT#SMTPCFG=1,465 an error occurred. Also when the command AT#SMTPCFG? is send,
    the answer is an error. (No error details, though 
    AT+CMEE=2).

     

    Some more details:

    Module: GL865
    Firmware:
    16.00.151-B005
    SSLEN is disabled, <FTPSEn> parameter of #FTPCFG and
    <ssl_enabled> parameter of #HTTPCFG are set to 0.

     

    Are there other settings involving this
    command?

     

    Best regards,

     

    Tanguy

    1. I think AT#SMTPCFG is supported since 16.01.xx0 firmware which in fact is the newest now.

      Check your email please.

      1. Dear,

         

        Thank you for the firmware update, this fixed the problem. 

         

        We still can’t send emails using gmail smtp. When entering the following commands, the error is: connection failed.

        AT#SGACT=1,1
        #SGACT: 10.x.x.x
        OK  

        AT#SSLSECCFG=1,0,1
        OK

        AT#SSLEN=1,0
        OK

        AT#SMTPCFG=1,465
        OK

        AT#ESMTP="smtp.gmail.com"
        OK

         

         EADDR,EUSER,EPASSW: OK,OK,OK

         

        AT#EMAILD="receiver","subject"
        >Test
        0x1A

        Then, the error is error 412: connection failed.
        Also, when trying on port 587, the same error occured. 

         

        We already set the SSL certificate for gmails smtp server.
        The certificate has been entered using this syntax:

         

        —–BEGIN
        CERTIFICATE—–<LF>

        MIIDVDCCAjygAwIBAgID…<LF>

        MRYwFAYDVQQKEw1HZ…<LF>

        —–END
        CERTIFICATE—–<LF>
        0x1A<CR><LF>

         

        Is this the right way?

  2. Hi,

    The first issue should be port related.
    Port 465 should be used for SMTPS protocol (SMTP over TLS).
    Whereas port 587 uses plain SMTP and the encryption is started afterwards with STARTTLS command.
    So the correct command should be AT#SMTPCFG=1,587

    The second issue should be certificate related.
    This certificate should work with Gmail:
    AT#SSLSECDATA=1,1,1,1162
    >
    Certificate in the attachment.

    1. Hi,

       

      We fixed the issue by using port 587 and entering the provided certificate.

       

      Altough I have one more question: 
      In the SSL/TLS user guide  is mentioned (page 18):

       

      Warning: Certificates MUST be in PEM format. When you store them within the module, remember that at the end of each command-line only the <LF> character is needed (without <CR>). Furthermore, be aware that some serial terminals add an undesired EOF at the end of the certificate; in this case EOF must be removed before entering <ctrl>Z.

      It is advisable to note that when using PEM format, the reserved chars “backspace” and “escape" are interpreted as control characters and the corresponding action is immediately executed.

       

       

      While the size of the certificate is 1162 bytes, including both LF and CR?

       

      Is this a mistake in the datasheet?

      Many thanks,
      Tanguy 

       

    2. Hi,

      The first issue should be port related.
      Port 465 should be used for SMTPS protocol (SMTP over TLS).
      Whereas port 587 uses plain SMTP and the encryption is started afterwards with STARTTLS command.
      So the correct command should be AT#SMTPCFG=1,587

      The second issue should be certificate related.
      This certificate should work with Gmail:
      AT#SSLSECDATA=1,1,1,1162
      >
      Certificate in the attachment.

      Hi,

      I have the same problems. can u attach the certificate mentioned above or please giude to create a certificate

      prakash

      1. Configure for example Mozilla Thunderbird to use your required service, then you can export certificates from its store.

        1. Hi,

          I have generated a certificate for gmail smtp port 587 using OpenSSL. The certificate attached.

          after loading the certificate I tried to send an email. But I am getting Error at the final stage. The AT commands and reply attached.

          Can u please figure out the mistake in my approch? is there anything wrong with the certificate I generated through OpenSSL?

          (I tried using port 465 also)

          Prakash

          1. Hi,

            That is not the root certificate, it is the third certificate in the chain.
            You should have downloaded the certificate at top of the chain.

            But even that certificate may not be the last certificate in the chain.
            You should open the file and check it.
            The last certificate in the path (chain) have the same subject entity in “Issued For” and “Issued By” fields.

            In this Gmail’s example, the last certificate displayed by openssl is a “GeoTrust Global CA”.
            If you open this GeoTrust certificate, you will see that is Issued by “Equifax Secure Certification Authority”.
            This Equifax is the root certificate that you need.

             

          2. Hi,

            I tried various combinations with with the certificate received from you. But could not succeed.

            Is it possible for you to provide online help/support via team viewer. If so please please fix a convenient time for tomorrow.

            Prakash

            (prakash@cellcommsolutions.com)

          3. Hi,

            Thank you. It is working now. (gmail was blocking the sign in from the modem. now this blocking is disabled in gmail)

            Prakash

          4. Hi,

            How can we configure more than 1 receipients in the mail using AT#SMTPCL? (the same email should reach multiple receipients)

            Prakash

  3. Hi,

    Sorry for my late response.

    This note is there for retro-compatibility (the part).

    At least in your SW version the import should work with and characters at the end of each line (of the certificate in PEM format).
    Anyway, you can follow the guide and import a certificate with only character at the end.