Install software:

opkg update
opkg install msmtp
mv /etc/msmtprc /etc/msmtprc.bk
nano /etc/msmtprc
account default
host smtp.gmail.com
port 587
auth on
user account@gmail.com
password password
auto_from off
from account@gmail.com
tls on
tls_starttls on
tls_certcheck off
logfile
syslog LOG_MAIL

Install software:

opkg update
opkg install mutt
nano ~/.muttrc
set sendmail = /usr/bin/msmtp

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