Tuesday, January 26, 2010

linux command sendmail with subject

If you send mail using sendmail command, there is no option for subject.
For example:
sendmail -F "system admin" -t "youself@gmail.com" < security.logHere is the trick how to using sendmail command to send mail with subject1, create your log file which you want to email to yourselfadd following line in the front of log file=====================#!/bin/shecho "From: system admin" > security.log
echo "To: youself@gmail.com" >> security.log
echo "Subject: security log" >> security.log

2, using this command to send mail

sendmail -oi -t < security.log



No comments:

Post a Comment