Sendmail from the command line
I am trying to figure out how I can append a subject to sendmail from the command line. I am using RH Enterprise.
using bash shell sendmail -f"from name" "recipient" <"file" that sends the mail but no subject. I have tried this as well mail -s"Subject header" "recipient" <"file" But that will not allow me to change the from address. It send it saying root, when I am trying to mask that. any suggestions would be greatly appreciated. thanks. back to :study: |
You should be able to read in a file like the following into "sendmail -t"
Code:
to:recipient@somewhere.com |
I am sending a log file that I created, so I will have to try to format the log file in a manner that corresponds with your advice and see if that gives me what I am looking for.
|
I haven't tried this but you should be able to do it with 2 files, one being the static header and the other being the log:
cat header.txt file.log | sendmail -t Just remember to have the extra newline at the bottom of the header file. |
Quote:
Code:
cat - file.log << EOF | sendmail -t Ever done: grep Error | vim - Same concept combined with a little extra bash-fu |
sendmail configuration
I am in need of configuration settings and steps for sending mails from linux server to some other domain or network.
I need to send mail from linux system to my mail id.Please help me out in doing the same. |
All times are GMT -5. The time now is 02:45 AM. |