logo elektroda
logo elektroda
X
logo elektroda

SIM800C GSM Module: Sending Email via SMTP on Port 587 Without SSL

czasnagli 1200 8
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18196203
    czasnagli
    Level 17  
    Welcome!

    I did a test of the GSM module SIM800C , which I used to send an email using the SMTP protocol. During the test, I sent AT commands to the module via the YAT terminal, and the whole process can be seen below. To summarise, I will write that I sent the email using the outgoing mail server smtp.poczta.onet.pl on port 587 (without SSL encryption).

    Connection diagram.

    SIM800C GSM Module: Sending Email via SMTP on Port 587 Without SSL .

    AT commands sent.

    Spoiler:
    Code: HTML, XML
    Log in, to see the code
    .
    SIM800C GSM Module: Sending Email via SMTP on Port 587 Without SSL .
  • ADVERTISEMENT
  • #2 18204387
    krzbor
    Level 27  
    It is difficult to say what is wrong, but it could be that only encrypted transmission is allowed on port 587 i.e. STARTTLS is required. There is a dialogue going on with the mail server i.e., every message sent has a response - see if there are no AT commands to see these responses - "OK" is not a server response but rather a confirmation that something has been sent. On Windows you can install telnet (it's in the additional applications) you can then issue the command:
    telnet smtp.poczta.onet.pl 587
    and talk to the server (read about the SMTP protocol to know how to talk)
  • ADVERTISEMENT
  • #3 18204556
    czasnagli
    Level 17  
    krzbor wrote:
    It is difficult to say what is wrong, but it could be that only encrypted transmission is allowed on port 587 i.e. STARTTLS is required.
    .
    This topic is not a description of the problem, but a working example of how to send an email using SMTP. Port 587 is for connections without SSL encryption.
    krzbor wrote:
    There is a dialogue going on with the mail server i.e., every message sent has a response - see if there are no AT commands to see these responses - "OK" is not a server response, rather a confirmation that something has been sent.
    .
    Confirmation that an email has been sent is the response +SMTPSEND: 1 .

    SIM800C GSM Module: Sending Email via SMTP on Port 587 Without SSL .
  • #4 18205385
    krzbor
    Level 27  
    For Gmail:
    TLS/STARTTLS connection:
    Outgoing mail server - smtp.gmail.com - port - 587
    Port 587 is usually for encrypted and unencrypted transmission. The start is always unencrypted, but once the connection is established there may be STARTTLS and a switch to encryption. Of course, onet may work differently.
    Have you checked the response (dispatch confirmation) if you enter intentionally wrong authorisation data? Is it also always "OK"?
  • #5 18205447
    czasnagli
    Level 17  
    krzbor wrote:
    Have you checked the response (shipping confirmation) if you enter intentionally wrong authorization data? Is it also always "OK"?
    .
    If I enter incorrect authorisation data then the module returns OK , followed by +SMTPSEND: 67 .
  • ADVERTISEMENT
  • #6 18205728
    krzbor
    Level 27  
    That is, communication and authorisation is OK. Rather, the SMTPSEND result can also be trusted. This leaves the problem of the SMTP server rejecting such a message. Servers can verify the "FROM" with the real address (account) - in your case, however, there is a match. Maybe it doesn't like sending to itself? If you have access to another SMTP server then you can check another server.
  • ADVERTISEMENT
  • #7 18205987
    czasnagli
    Level 17  
    krzbor wrote:
    There is therefore the problem of the SMTP server rejecting such a message.
    .
    The SMTP server did not reject the message because I read it on Onet mail. I wrote in the first post that the email was sent successfully. I repeat again that this topic is not a description of the problem.
  • #8 18206178
    krzbor
    Level 27  
    And I thought you were sending, you have the correct status and the mail is not coming :) .
  • #9 18206878
    czasnagli
    Level 17  
    krzbor wrote:
    And I thought you were sending, you have the correct status, and the mail is not coming :)
    .
    Everything is working properly. :) I would still add that the module described above only supports connections without SSL.

Topic summary

The discussion revolves around the use of the SIM800C GSM module to send emails via the SMTP protocol on port 587 without SSL encryption. The user successfully sent an email using the outgoing mail server smtp.poczta.onet.pl and shared the AT commands used during the process. Responses from other participants highlighted potential issues with server requirements for encrypted transmission, the importance of checking server responses, and the confirmation of successful email sending indicated by the response +SMTPSEND: 1. The conversation clarified that the module only supports non-SSL connections and confirmed that the email was received successfully on the Onet mail server.
Summary generated by the language model.
ADVERTISEMENT