i needed this so i searched and now i want to share with you, is very easy, you can accomodate this basic example to your needs... maybe would be good if include this settings in luci in the future and use it for sending some events:
first enable your gmail account to use less secure applications (google >account settings >login&security >at bottom)
install 'ssmtp' throught luci or uci
edit /etc/ssmtp/ssmtp.conf
mailhub=smtp.gmail.com:587
hostname=your.domain
FromLineOverride=YES
UseTLS=YES
UseSTARTTLS=YES
AuthUser=your.account@gmail.com
AuthPass=your.password
you can create a mail.txt file (or use stdin or whatever)
From: "your alias" <your.account@gmail.com>
Subject: ssmtp test
your message
blah
now you can send your mail, and optionally add "-v" to view servers dialog
root@OpenWrt:/etc/ssmtp# cat mail.txt|ssmtp -v your.recipient@his.domain
[<-] 220 smtp.gmail.com ESMTP qweqweqweqwe.23 - gsmtp
[->] EHLO your.domain
[<-] 250 SMTPUTF8
[->] STARTTLS
[<-] 220 2.0.0 Ready to start TLS
[->] EHLO your.domain
[<-] 250 SMTPUTF8
[->] AUTH LOGIN
[<-] 334 sdfsdFSDFsdfSDF
[->] fsdFSDFsdfDSFSDfSDFsdF
[<-] 334 asdASDasDASDS
[<-] 235 2.7.0 Accepted
[->] MAIL FROM:<your.account@gmail.com>
[<-] 250 2.1.0 OK qweqweqweqwe.23 - gsmtp
[->] RCPT TO:<your.recipient@his.domain>
[<-] 250 2.1.5 OK qweqweqweqwe.23 - gsmtp
[->] DATA
[<-] 354 Go ahead qweqweqweqwe.23 - gsmtp
[->] Received: by your.domain (sSMTP sendmail emulation); Fri, 16 Sep 2016 16:15:10 +0000
[->] Date: Fri, 16 Sep 2016 16:15:10 +0000
[->] From: "your alias" <your.account@gmail.com>
[->] Subject: ssmtp test
[->]
[->] your message
[->] blah
[->] .
[<-] 250 2.0.0 OK 1474042513 qweqweqweqwe.23 - gsmtp
[->] QUIT
[<-] 221 2.0.0 closing connection qweqweqweqwe.23 - gsmtp
(Last edited by atesin on 16 Sep 2016, 19:49)