[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A Question about the Application Called mail or mailx



On Wed, Jul 22, 2015 at 12:40:27PM -0500, Martin G. McCormick wrote:
> 	The old "mail" application or "mailx" if one has
> heirloom-mail does work but I have a question about piping a
> message to it.
> 
> 	It looks from documentation that mail can read headers
> such as:
> 
> From: "martin McCormick" <martin@myhost.net>
> To: martin@testhost.com
> Subject: Will this ever work?
> 
> that are embedded in a message file if one sends a command
> something like
> 
> mail -t [filename]
> 
> but what actually happens when I try this is an error stating
> a complaint that there are no recipients on the command line.
> 
> 	That's right. I put them in the file so I shouldn't have
> to put them in the command line.
> 
> 	Should this work and produce a sent message?

mail -t needs to be followed by an address, not a message body.

If you want to send a full message which has all needed headers,
trust the "sendmail" command which is shipped by anything which 
can supply the MTA package role. 

exim, sendmail, postfix, qmail, masqmail... they all give you
a sendmail command which will do what you want.

-dsr-


Reply to: