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



2006-05-19, 00:38(-07), Prasad:
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_joshi1@xxxxxxxxxxxx <<< "TEST"
[...]

You need to provide the headers. sendmail will add some headers
if you fail to provide them (such as Message-Id, Date...) but it
expects that you provide the headers. sendmail is to send raw
emails. You should consider using the mailx command instead.

Or:

sendmail -oi -t << EOF
From: Prasad Joshi <your@address>
To: Prasad <prasad_joshi1@xxxxxxxxxxxx>
Subject: the subject

Body of the message
EOF

The headers are separated from the body by an empty line.

"-t" tells sendmail to look for the addresses to send this to in
the To: and Cc: (and possibly Bcc: in which case it will remove
it before sending the email) headers of the message.

--
Stephane
.



Relevant Pages

  • Technical Support Bulletin
    ... Sendmail is a MTA that resources. ... headers are parsed ... This vulnerability may allow ... attacker to cause a denial of service attack ...
    (AIX-L)
  • Re: daemon MTA-IPv4: Problem creating SMTP socket?
    ... So whatever is squatting your machine's port 25 hasn't been found ... The netstat command doesn't list processes, ... For this round, however, whe know there is a sendmail process and ...
    (comp.mail.sendmail)
  • Re: Problem Sendmail
    ... Sendmail is working in my domain. ... IBM Certificate of Proficiency - AIX Installation, ... This communication may contain confidential, ... How configure sendmail as a client in AIX to send mails without hostname? ...
    (AIX-L)
  • mails remain in clientmqueue and is not sent
    ... I've a very sudden problem on one of my servers. ... Mails send by sendmail remain there forever and never are copied to mqueue or even sent. ...
    (comp.mail.sendmail)
  • Summary: mailx mails not sent out or not arriving?
    ... We're running sendmail Ver 8.12.10. ... Try it from the command line with the verbose flag ... sun-host:~$ 250 2.0.0 j7RJ0hmH004928 Message accepted for delivery ... my company has instituted a spam filter which occasionally ...
    (SunManagers)