- This topic has 0 replies, 1 voice, and was last updated 3 hours, 43 minutes ago by .
Viewing 0 reply threads
Viewing 0 reply threads
- You must be logged in to reply to this topic.
Home › Forums › The libraries hosted on the site › EMailSender send email with attachments › SMTP server to use with the EMailSender library › Local SMTP Relay Setup (For Gmail/Outlook)
Tagged: Arduino, EMailSender, relay
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
More