You should be able to do it with simple scripting.
"Send an email [with SMTP]" though is a huge security hole in any system as you'll need to authenticate the router to your mail server. Doing so would mean that, when compromised, it could become a spam bot without much effort.
I'd look into more secure solutions, such as using MQTT or keyed, command-restricted ssh to trigger a different a pre-defined message to be sent to a predefined recipient on a more secure and less exposed host.
Secure logging, with something like syslog-ng to a remote host, preferably with TLS and authentication (which it supports).
Packages are available for what you need, depending on the route you decide on.