Install software:

opkg update
opkg install ssmtp
mv /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.bk
nano /etc/ssmtp/ssmtp.conf
root=XXX@gmail.com
mailhub=smtp.gmail.com:587
rewriteDomain=
hostname=XXX@gmail.com
UseSTARTTLS=YES
AuthUser=XXX@gmail.com
AuthPass=XXX
FromLineOverride=YES

Install software:

opkg update
opkg install mutt
nano ~/.muttrc
set sendmail = /usr/sbin/ssmtp

Send email via Gmail server:

echo "body of email" | mutt -s "subject of email" address@gmail.com

Send email with attachment via Gmail server:

echo "body of email" | mutt -s "subject of email" -a /file/to/attach.txt address@domain.com