Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-06-2005, 10:08 PM   #1
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Rep: Reputation: 30
write a shell script to send email


i have a dailed-up machine (FC2) serving as Internet gw and Web proxying, remotely operated at another town. through, firewall setting, i have configured in such a way that, the machine only accept ssh from my own static ip gateway. but, the trouble is that, everytime the machine reboots. network service is restarting, firewall rule is loading, then, i have to call them and ask the office boy to get me the new dailed ip. pretty stupid, huh?. can i have a script, once the ip (internet gw ip, i mean) is changed, then, it will straight email to my account?? could it be possible??? give me a pointer to look into it. thanks...

Old 02-06-2005, 11:15 PM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,710

Rep: Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520
Try or . I believe they have the right service for you
Old 02-07-2005, 06:37 AM   #3
Senior Member
Registered: Mar 2004
Location: england
Distribution: Void, Debian, Puppy, Raspbian
Posts: 3,483

Rep: Reputation: 223Reputation: 223Reputation: 223
sending email is easy from the command line/shell script


cat  FILE | mailx -s Subject    me@blah.sol.mars
Old 02-11-2005, 10:40 PM   #4
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
do i need to set the default smtp server?? thanks
Old 02-11-2005, 11:06 PM   #5
Senior Member
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
ifconfig ppp0 | mail -s "IP information"

The need for an SMTP server is dependant on *many* things. To be correct, you'd be best off setting the local MTA to forward all email (for which it's not the final destination) through your ISP's SMTP gateway unless you have control over your reverse DNS, yadda yadda yadda ...

Last edited by sigsegv; 02-11-2005 at 11:08 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to send email... bfloeagle Linux - General 5 10-13-2009 11:20 AM
Write a script to send an email from bash kpelczar Linux - Software 5 02-09-2005 05:19 PM
Qmail: send email from shell mikeshn Linux - General 1 09-30-2004 02:19 AM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 04:00 PM
send email through shell mikeshn Linux - General 10 01-01-2004 03:35 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration