Roland Roland wrote:
i'm trying to get a script to send me an email whenever a certain condition takes place.. i'm afraid i dont have experience with mail command nor anything else related to sending emails for that matter..
i googled a bit and tried using mutt and mail ... though i do not recieve any email in my inbox...
the command im using is the following : mail -s “disk space report” R_O_L_A_N_D@hotmail.com
should i setup a default smtp to use? where can i check for the errors that are taking place?
I shouldn't really post this, as I am so far from being an expert, but I use the following script to send (daily) the email address of a remote machine: --------------------------------------- #!/usr/bin/python
SENDMAIL = "/usr/sbin/sendmail" import os import sys import time tt = time.ctime() f = os.popen("stunbdc stun.ekiga.net 2>/dev/null") ipaddr = f.read() f.close() p = os.popen("%s -t -fgayleard@alice.it" % SENDMAIL, "w") p.write("To: gayleard@eircom.net\r\n") p.write("From: Timothy Murphy gayleard@alice.it\r\n") p.write("Subject: Anghiari IP address\r\n") p.write("\r\n") p.write(tt + "\r\n") p.write(ipaddr + "\r\n") p.close() sys.exit() ---------------------------------------
I found I have to add the -f switch (with a local address) to satisfy the remote ISP.
But this is probably far from your needs.