Mail command in scripting?

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
aliG
Posts: 76
Joined: Sun 15 Jul 2007, 09:52
Location: Glasgow, Scotland

Mail command in scripting?

#1 Post by aliG »

Puppy Server : Puppy 4.31 - Mini-ITX embedded PC with 4GB CF card, frugal install, open2300 weather software, total power 6W!

Hi,

I have a script program running on my "Puppy server" that checks a number of properties and I want to be able to send a mail message when some are exceeded. The problem I have is I can't find a way of sending mail?

I'm not a programmer , but have some scripting experience is in Unix on Sun Solaris or Silicon Graphics workstations . Normally I would have written something like

Code: Select all

if [ $wind_speed_now > $wind_speed_max ] 
then
  mail alison@host < warning_message.txt
fi
The email address I want to use is on an external domain i.e. I want something like "mail alison@externaldomain.co.uk"

However there is no native "mail" command in Puppy, nor in busybox. , my ISP provides a SMTP server, so what I am looking for is a way of using this from within a script.

I've read about "send mail" but can't see it in Puppy, and I'm no linux admin! does anyone know of a simple way to do this?

Thanks for reading this far
Alison

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#2 Post by trapster »

Here ya go:
email-3.1.2.pet

Email webpage Here
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

Shep
Posts: 878
Joined: Sat 08 Nov 2008, 07:55
Location: Australia

Re: Mail command in scripting?

#3 Post by Shep »

aliG wrote:my ISP provides a SMTP server, so what I am looking for is a way of using this from within a script.
Hi aliG. That nym rings a bell. :lol:

I wrote a telnet script that I use to send mail. The script just throws the prepared mail message onto the SMTP server. My script basically automates what you would do were you to telnet to the sever manually, e.g., telnet mail.your-isp.com 25

Experiment with that, and see whether you can manage to send a mail message using SMTP commands. A google search will find you the information on what commands you need.

If you don't need to authenticate, then it is even easier and can use nc.

PM me if you need more.

aarf

#4 Post by aarf »


User avatar
aliG
Posts: 76
Joined: Sun 15 Jul 2007, 09:52
Location: Glasgow, Scotland

#5 Post by aliG »

Thanks All - I have downloaded and installed "email" - has a lot of options will find some time later in the week to give it a go.

Post Reply