Hi all,
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?
Look for erros in /var/log/maillog. Do you have sendmail running?
On Fri, Jan 15, 2010 at 11:15 AM, Roland Roland R_O_L_A_N_D@hotmail.com wrote:
Hi all,
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? _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Fri, Jan 15, 2010 at 11:33:02AM -0200, Lincoln Zuljewic Silva wrote:
Look for erros in /var/log/maillog. Do you have sendmail running?
On Fri, Jan 15, 2010 at 11:15 AM, Roland Roland R_O_L_A_N_D@hotmail.com wrote:
Hi all,
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? _______________________________________________
If you don't have sendmail (or other smtp agent) running, and configured to be able to properly deliver mail, you may need to figure out how to do that.
Or, if your only need for sending mail on that particular computer is for this single purpose, you may find it easiest to try the package "SendEmail", a smtp sender written in perl, which requires no configuration and can be controlled entirely from the commandline. You can find it at: http://caspian.dotconf.net/menu/Software/SendEmail/
I'm using it as a reporting tool for an unattended app I've written, and it works great.
Fred
At Fri, 15 Jan 2010 15:15:48 +0200 CentOS mailing list centos@centos.org wrote:
Hi all,
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?
If it is a default CentOS install, you should have sendmail installed, but you probably need to install sendmail-cf and create a site specific sendmail.cf file (from a site specific sendmail.mc file).
Look in /var/log/maillog for error messages.
The 'mail' command is the correct thing to use, except you need to bind stdin to something. Eg:
df -h | mail -s "Disk space report" mumble@whatever.com
or
mail -s "Disk space alert!" mumble@whatever.com </dev/null
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
From: Roland Roland R_O_L_A_N_D@hotmail.com
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?
Tried with sendmail service started...? Check /var/log/maillog
An other way: /usr/sbin/sendmail -t <<EOF Subject: ... to: ... Content-type: text/plain
Hello World... EOF
JD
Roland Roland wrote:
Hi all,
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?
Does your machine have a valid domain name? Most places will reject mail if the From: address can't be resolved, and the mail program will use the user running the command and the host name to construct this address. Look in /var/log/maillog to see if that is the problem.
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.
Here is what I use:
mail -s "My email subject" me@domain.com <$myfile
On some (older?) systems the command is email instead of mail. Check man mail
Regards, Jussi
On 15.1.2010 15:15, Roland Roland wrote:
Hi all,
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? _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Jussi Hirvi wrote on Fri, 15 Jan 2010 18:28:54 +0200:
mail -s "My email subject" me@domain.com <$myfile
Note the end of the command! I think it needs a body to get sent! I'm using it here like
some command | mail -s "My email subject" me@domain.com 2>1
which mails me the output of the command.
Kai
Jussi Hirvi wrote:
Here is what I use:
mail -s "My email subject" me@domain.com <$myfile
On some (older?) systems the command is email instead of mail. Check man mail
Regards, Jussi
mail is the standard unix command. Has been as long as I can remember, and I believe it is also part of LSB but I'm not positive on that.
Jussi Hirvi wrote:
Here is what I use:
mail -s "My email subject" me@domain.com <$myfile
On some (older?) systems the command is email instead of mail. Check man mail
mail is the standard unix command. Has been as long as I can remember, and I believe it is also part of LSB but I'm not positive on that.
I agree. It was standard on everything I was on when I first got into *Nix in '91.
mark "Sun 3(*not* Solaris), Irix, HP/UX...."
If you're using a typical residential broadband ISP, outbound SMTP may also be blocked by your provider as a mechanism to minimize mail abuse (spam). In such a case, you will need to configure your MTA (sendmail or whatever) to forward all mail through your ISP's official outbound mail server.
You can check this by issuing the command:
telnet mx1.hotmail.com smtp
(Note the second 'smtp' argument there.)
If you see something like the following, then type "quit" (no quotes) and hit enter/return:
Trying 65.55.92.152... Connected to mx1.hotmail.com. Escape character is '^]'. 220 snt0-mc2-f42.Snt0.hotmail.com Sending unsolicited commercial or bulk e-mail to Microsoft's computer network is prohibited. Other restrictions are found at http://privacy.msn.com/Anti-spam/. Violations will result in use of equipment located in California and other states. Fri, 15 Jan 2010 08:54:58 -0800
If it doesn't do anything after "Trying 65.55.92.152..." or gives you a connection refused, your ISP is blocking SMTP.
If your telnet appears hung, type control-] (right square bracket) to get to the telnet prompt, then type "quit" (no quotes) and enter/return.
Devin