I use my Synology NAS with a VPN which is always connected. In response to some events I wanted to send custom email notifications (btw if you are interested in this part I recommend this excellent article Send Custom (email) Notifications from scripts running on a Synology).
I use the Gmail’s smtp server with one of my email.
In general there are several things you need to do to make it work:
- Ask your vpn provider to whitelist the ip of the gmail smtp you resolve once connected (to get the ip you resolve from vpn: ssh/telnet to your nas with root user and
ping -4 smtp.gmail.com). Indeed most providers block smtp in order to prevent spams. My provider (privateinternetaccess) has whitelisted the ip in 24h
- Fill the ip in the notification panel (as on the picture)
- Send a test mail
- If you receive a mail from Google saying your account might have been hacked log on gmail, then go to https://accounts.google.com/DisplayUnlockCaptcha and send a test mail again
It now should works! Hope it has helped 🙂