Search code examples
network-programminggmailip-address

Send email to Gmail server from IOT devices


I have an IoT device (SEL). I want to send an email to a company gmail email ([email protected]).

The IoT device requires the numerical IP address of the server, but I was informed that the IP address of the Gmail server always changes. How could I get the fixed IP address of the Gmail server?

Thanks. enter image description here


Solution

  • With the limitation of this device, I am afraid you will need a proper mail server/service that you can send to (specifying an ip) and that will send the email to the gmail servers.

    you can find the ip address of gmail servers with the dig command under linux

    dig +short gmail.com MX

    dig +short gmail-smtp-in.l.google.com A

    or online : https://www.digwebinterface.com/

    but it is most likely that gmail will flat out refuse your email for a few reasons; lack of spf record, lack of dkim record lack of reverse dns and lack of a matching A record and if the email comes from a redidential ip, although it is not part of the email standards, it might also get refused.

    if you can authenticate as an existing existing user in gmail (with user and password) (the screenshot provided does not show if it is a possibility) then you might be able to send as this specific user.