Sendmail

HI CAN ANYBODY HELP ME? I HAVE COME ACROSS A PROBLEM. I AM USING SENDMAIL IN HP-UX IN THE FOLLOWING MANNER

/usr/sbin/sendmail -t someone@someplace.com < /path/to/file.log

BUT THE RECEIPIENT DOESNOT GET THE ADDRESS IN THE TO: SECTION OF THE MAIL. ALSO I HAVE NOT FOUND ANY OPTION TO PUT A SUBJECT SO THAT ON SEEING THE SUBJECT, THE RECEIPIENT CAN IMMEDIATELY RECOGNISE THE MAIL.

SO IF ANYONE IS KNOWING HOW TO PUT A SUBJECT AND KEEPING THE MAIL ADDRESS IN THE TO: SECTION PLEASE HELP ME.

THANKS IN ADVANCE.

http://www.unix.com/shell-programming-scripting/45082-sendmail.html

Don't duplicate.

Does /path/to/file.log contain a prepared email with SMTP headers? Or are you trying to send a file attachment?

/path/to/file.log IS A FILE THAT HOLDS THE MATTER.THERE IS NOTHING OTHER THAN THAT.

cobroraj,

Please do not write in all-caps. That is against the rules.

i am sorry for that..thanks

You didn't really answer the question, so I'm going to assume you want to send the log file as an attachment...

(a) use uuencode to convert the log file into an attachment

(b) use mailx to send the message with both subject and recipient as command line arguments.

If that's not what you are trying to do then please clarify.

Another option if that log file is plain text (ie human readable), would be to add the To: From: and Subject: lines to the front of that file thus:

echo "From: me@here
To: You@there
Subject: Very important messages
" | cat - /path/to/file.log | /usr/lib/sendmail someone@someplace.com