LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   write a shell script to send email (https://www.linuxquestions.org/questions/programming-9/write-a-shell-script-to-send-email-287098/)

yenonn 02-06-2005 09:08 PM

write a shell script to send email
 
hi,

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...

Cheers,
yenonn

chrism01 02-06-2005 10:15 PM

Try http://www.no-ip.com/ or http://www.dyndns.org/ . I believe they have the right service for you

bigearsbilly 02-07-2005 05:37 AM

sending email is easy from the command line/shell script

try:

Code:

cat  FILE | mailx -s Subject    me@blah.sol.mars

yenonn 02-11-2005 09:40 PM

do i need to set the default smtp server?? thanks

sigsegv 02-11-2005 10:06 PM

ifconfig ppp0 | mail -s "IP information" user@host.com

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 ...


All times are GMT -5. The time now is 01:20 PM.