How to specify Subject line with the sendmail command?
You need to provide the headers. sendmail will add some headers if you fail to provide them (such as Message-Id, Date...) but it expects that you provide the headers. sendmail is to send raw emails. You should consider using the mailx command instead. Or: sendmail -oi -t << EOF
Body of the message
The headers are separated from the body by an empty line. "-t" tells sendmail to look for the addresses to send this to in the To: and Cc: (and possibly Bcc: in which case it will remove it before sending the email) headers of the message. Or: For mailing text, I would use mail -s "subject here" prasad_joseph@domain.com < filename_here Or: mailx -s "subject here" prasad_joseph@domain.com < filename_here Or: Send mail isn't intended at a user interface. You can type, line-for-line something like: send mail myemail@mycompany.com
Note the line that begins with "Subject:" triggers the subject line. The ^D is a control_D which signifies end-of-file.
Have a Unix Problem
Unix Books :-
Return to : - Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|