1834133 Members
2192 Online
110064 Solutions
New Discussion

Re: Sendmail

 
Jason Baldwin
Occasional Advisor

Sendmail

How do I add a subject field when using the sendmail command?
4 REPLIES 4
Robin Wakefield
Honored Contributor

Re: Sendmail

Hi Jason:

You need to start your message with:

Subject: your subject

start of message...
...
...

i.e. a blank line needs to separate the subject from the body, and the subject must start with "Subject: ", e.g.

echo "Subject: hello\n\nthis is a test" | /usr/lib/sendmail robin.wakefield@ubsw.com

Rgds, Robin.
Animesh Chakraborty
Honored Contributor

Re: Sendmail

Hi,
With -s option.
echo "test" | mailx -m -s "testing" abc@xyz.com



Animesh

Did you take a backup?
Thierry Poels_1
Honored Contributor

Re: Sendmail

Hi,

/usr/lib/sendmail -F sender_full_name recipient@host << [EOT]
Subject: This is the subject.

Here is the text of the message.
[EOT]


or through mailx:
mailx -s "your subject" recipient < mailfile

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Sanjay_6
Honored Contributor

Re: Sendmail

Hi Jason.

Try,

mailx -s "your subject over here" address@domain < your_mail_file

hope this helps.

Regds