NSLU2-Linux
view · edit · print · history

HowTo.SendMailWithMSMTP History

Hide minor edits - Show changes to markup

June 27, 2009, at 09:52 AM by Tony Wilson --
Changed line 31 from:
     to="To:myfriend@domain.com"
to:
     to="myfriend@domain.com"
Changed line 35 from:
     message=`echo -e "${subject}\n${from}\n${to}\n\n${content}"`
to:
     message=`echo -e "${subject}\n${from}\nTo:${to}\n\n${content}"`
June 17, 2009, at 10:17 AM by Tony Wilson --
Changed lines 1-3 from:

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

to:

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

June 17, 2009, at 10:16 AM by Tony Wilson --
Changed lines 1-3 from:

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

to:

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

June 17, 2009, at 09:50 AM by Tony Wilson --
Added line 3:
Changed lines 7-8 from:

You must create configuration file: /root/.msmtprc

to:

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

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

Deleted line 20:
June 17, 2009, at 09:43 AM by Tony Wilson --
Changed lines 20-24 from:

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

to:
  chown root /root/.msmtprc
  chmod 600 /root/.msmtprc
June 17, 2009, at 09:42 AM by Tony Wilson --
Changed lines 8-22 from:

account default

host smtp.isp.com

from me@isp.com

auth on

user myusername

password secret

to:
  account default
  host smtp.isp.com
  from me@isp.com
  auth on
  user myusername
  password secret
June 17, 2009, at 09:41 AM by Tony Wilson --
Added line 9:
Added line 11:
Added line 13:
Added line 15:
Added line 17:
Added line 22:
June 17, 2009, at 09:41 AM by Tony Wilson --
Deleted line 7:
  1. An isp service
Added line 16:
June 17, 2009, at 09:40 AM by Tony Wilson -- Send email via your ISP using MSMTP only.
Added lines 1-38:

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

More info here: http://msmtp.sourceforge.net/

You must create configuration file: /root/.msmtprc

  1. An isp service

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="To:myfriend@domain.com"
     subject="subject:My Subject"
     content="My text"

     message=`echo -e "${subject}\n${from}\n${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