Operating System - HP-UX
1828662 Members
1286 Online
109983 Solutions
New Discussion

Re: how to specify Subject line with the sendmail command?

 
SOLVED
Go to solution
Prasad Joshi
Regular Advisor

how to specify Subject line with the sendmail command?

Hi All,

I want to send a mail from command line, I am using sendmail command
for the same.

I tried sending mails to myself. I am able to send mails but, i don't
know how to specify Subject line.

I used command
# sendmail -F "Prasad Joshi." -t prasad_jos...@symantec.com <<< "TEST"

This is how the header of the message looked like,
From: Prasad Joshi.
To: undisclosed-recipients : ;
Subject: No Subject
Date: Fri, 19 May 2006 13:06:03 +0530 (IST)

How can Subject line be specified?
How can i specify the From mail ID?
How to specify the Subject?

Thanks in advance.

Thanks & regards,
Prasad.
3 REPLIES 3
Arunvijai_4
Honored Contributor
Solution

Re: how to specify Subject line with the sendmail command?

Hi Prasad,

You can use "mailx" with -s to send messages with subject.

-Arun

"A ship in the harbor is safe, but that is not what ships are built for"
Peter Godron
Honored Contributor

Re: how to specify Subject line with the sendmail command?

Prasad,
have you tried:
echo "TEST" | mailx -s "Subject" prasad_jos@symantec.com

or if you want to send a file:
mailx -s "Subj" prasad_jos...@symantec.com < file
Prasad Joshi
Regular Advisor

Re: how to specify Subject line with the sendmail command?

Thanks lot.