Send Email on OpenWrt

Use SSMTP, this is a program to deliver an email from a local computer to a configured mailhost.
Install with Luci/System/Software, or command line on SSH:
opkg update
opkg install ssmtp

Edit /etc/ssmtp/ssmtp.conf :

 #
 # /etc/ssmtp.conf -- a config file for sSMTP sendmail.
 #
 # The person who gets all mail for userids < 1000
 # Make this empty to disable rewriting.
 root=username@gmail.com
 # The place where the mail goes. The actual machine name is required
 # The example will fit if you are in domain.com and your mailhub is so named.
 mailhub=smtp.gmail.com:587
 # Where will the mail seem to come from?
 #rewriteDomain=
 # The full hostname
 hostname=username@gmail.com
 UseSTARTTLS=YES
 AuthUser=username@gmail.com
 AuthPass=gmailpassword 
 # Set this to never rewrite the "From:" line (unless not given) and to
 # use that address in the "from line" of the envelope.
 FromLineOverride=YES 
 # Use SSL/TLS to send secure messages to server.
 UseTLS=YES 
 # Use SSL/TLS certificate to authenticate against smtp host.
 #UseTLSCert=YES
 # Use this RSA certificate.
 #TLSCert=/etc/ssl/certs/ssmtp.pem 
 # Get enhanced (*really* enhanced) debugging information in the logs
 #Debug=YES

Make e-mail txt:

To: destination.address@etc.com
From: your.email@gmail.com
Subject: Test
Hello world!

Try:

ssmtp destination.address@etc.com < mail.txt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s