Local SMTP Relay Setup (For Gmail/Outlook)

Viewing 0 reply threads
  • Author
    Posts
    • #33501
      Renzo Mischianti
      Keymaster

        If you need to use Gmail or Outlook, create an SMTP relay on a Raspberry Pi or PC:

        Postfix on Raspberry Pi

        # Install Postfix
        sudo apt install postfix mailutils
        # Configure as a relay to Gmail
        sudo nano /etc/postfix/main.cf
        # Add:
        # relayhost = [smtp.gmail.com]:587
        # smtp_sasl_auth_enable = yes
        # smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
        # smtp_sasl_security_options = noanonymous
        # smtp_tls_security_level = encrypt

        Arduino connects to the Raspberry Pi:

        // Arduino → Raspberry Pi (no SSL) → Gmail (with SSL)
        EMailSender emailSend("your@gmail.com", "apppassword",
                              "your@gmail.com", "Arduino",
                              "192.168.1.100",  // IP of the Raspberry Pi
                              25);              // Local port without SSL
    Viewing 0 reply threads
    • You must be logged in to reply to this topic.
    Exit mobile version