Hi,
Can anyone kindly provide some information about how to populate the subject field of the email while using the sendmail utility ? Itried the following command line argument :
echo -e "Body of the email" | /usr/lib/sendmail -f from@from.com -t to@to.com -s " Subject of the email"
While running this, although the mail reaches with the body as mentioned,but the subject field remains blank.
Hi panyam,
Thanks for the reply. However, could you please clarify which one is the excat option for popualting the subject line of the email ? Is it -t or -i ?
-t Read message for recipients. To:, Cc:, and Bcc:
lines will be scanned for recipient addresses. The
Bcc: line will be deleted before transmission.
-i Ignore dots alone on lines by themselves in incoming
messages. This should be set if you are reading from
a file.
It is a freak of luck and guesswork that your example line sent a mail. The "sendmail" command line syntax is nothing like "mailx" but "sendmail" does allow you to construct an email in any format. The post from "panyam" is very good and correctly illustrates how to send a basic email from "sendmail".