subject option for command line sendmail

i have a perl script that uses sendmail to send out a list of emails- nowhere in the man page or sendmail.org FAQ does it even mention the notion that there is a subject in email:p
slithytoveAsked:
Who is Participating?
 
mnewnhamConnect With a Mentor Commented:
Thats because sendmail is not a front end mailer:- it assumes that the message it is getting is already fully formed including headers. the easiest way to do this is to add a subject line to a message before you pass it to sendmail,e.g if you had a message:

Mary had a little lamb
Its fleece was white as snow.

create the message as

Subject: Mary's lambs
<blank line>
Mary had a little lamb
Its fleece was white as snow.

Then pass that off to sendmail.

alternatively, use mailx as your mailer, where you can use the -s"subject" option.
0
 
slithytoveAuthor Commented:
thanks- I know I did this years ago and now I remember:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.