NSLU2-Linux
view · edit · print · history

MSMTP allows you to send email via your ISP using a shell script.

More info here: http://msmtp.sourceforge.net/(approve sites)

Install package msmtp (Easy way: http://www.nslu2-linux.org/wiki/Optware/Ipkg-web)

You must then create configuration file: /root/.msmtprc

  account default
  host smtp.isp.com
  from me@isp.com
  auth on
  user myusername
  password secret

then:

  chown root /root/.msmtprc
  chmod 600 /root/.msmtprc

To send email from your script:

     from="From:me@isp.com"
     to="myfriend@domain.com"
     subject="subject:My Subject"
     content="My text"

     message=`echo -e "${subject}\n${from}\nTo:${to}\n\n${content}"`

     echo "$message" | msmtp ${to}
view · edit · print · history · Last edited by Tony Wilson.
Originally by Tony Wilson.
Page last modified on June 27, 2009, at 09:52 AM